Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PTNOP's avatar
Level 1

The GET method is not supported for this route. Supported methods: HEAD.

I am new at laravel, but please good F**k, i am going crazy! I have install all with composer i have install bootstrap --auth

I have try evertyting and i only have this 2 routes (attached image link) at the moment i have remove any route from api.php (had 1 default route)

My routes:

Route::get('/', 'HomeController@home')->name('home');
Route::get('/home', 'HomeController@index')->name('index');

My homeController.php

       namespace App\Http\Controllers;

        use Illuminate\Http\Request;

       class HomeController extends Controller
      {  

         public function __construct()
        {
           $this->middleware('guest');
         }

       public function index()
      {
        return view('home');
        }
      public function home()
      {
      return view('welcome');
      }
  }

But i still get this messa i have try get i have try post i have try match(array('GET', 'POST'), and nothing!

Please help me :(

Image link: https://ibb.co/PrH6Ff9

0 likes
13 replies
Snapey's avatar

what are you doing when you get the error?

PTNOP's avatar
Level 1

The php artisan optimize don't have that included??

wow , omg Thanks it works sorry being to noob but i have search on google and i have try almost evryting i have find sorry :(

Snapey's avatar

You will have less problems generally if you host your site correctly. the public folder should be the document root and therefore you should not see public in the URLs that you are accessing.

1 like
PTNOP's avatar
Level 1

This is in localhost, and the project folder is inside htdocs like this.

htdocs/projectfolder/public

Snapey's avatar

yes, I know. That is why I gave you the suggestion to sort it out before you run into other problems

1 like
PTNOP's avatar
Level 1

All the sugestions are welcome!

And thank you, because I am a novice and I am always learning at this moment I was not yet focused on that, but since you speak you can say how I can achieve this or give you any tips. Thank you very much

PTNOP's avatar
Level 1

I have found something strange that i don't no why is happening, if i do for exemple

   php artisan optimize

i get the error (the get method is not ....) to pass this i have to

   php artisan route:clear

every time but why? any have any explation ? thanks in advance :)

1 like
PTNOP's avatar
Level 1

oh s**t laravel 7 lol thanks for that info not reading docs give in this!

Snapey's avatar

You set your web server to serve the public folder instead of htdocs. Instructions are dependent on what webserver you use.

Alternatively run php artisan serve in your project folder

1 like

Please or to participate in this conversation.