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

AbdulBazith's avatar

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

Guys i have doubt, i need to create a user defined function in POST method.

let me explain what i did

my route

Route::resource('MyTeam', 'MyTeamController');

Route::post('ManageTeam', 'MyTeamController@ManageTeam')->name('ManageTeam');

my form

<form name="team_check" id="team_check" method="post" action="{{ route('ManageTeam') }}">

if i use like above i get the error message

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

but if i use get in both side it works fine. but if i use POST in both side, i get the above error message but, this sometimes the error message is not there, works fine. sometimes iam getting this error message.

  1. if i use more than one form tag with different function in a form this error comes??

2)basically a resource controller has index,create, store, show,edit,update, destroy.

without resource controller i need to create a controller with these functions means what should i do

i can give like this php artisan make:controller MYNEWcontroller so i have created a controller now how to declare this in route.php

i expect like this in this new controller with post method.

userdefinedcreate(),
userdefinedindex(),
userdefinedstore(Request $request),
userdefinedshow($id),
userdefinededit($id),
userdefineupdate(Request $request, $id),
userdefineddestroy($id),

Kindly some one help please

0 likes
10 replies
automica's avatar

@abdulbazith can you post all your routes rather than the 2 you have posted?

also run command.

php artisan route:list

its likely that you have overridden your POST ManageTeam route with a GET further down the routes.

regarding

i can give like this php artisan make:controller MYNEWcontroller so i have created a controller now how to declare this in route.php

eg:

php artisan make:controller PhotoController --resource

Route::resource('photos', PhotoController::class);

see https://laravel.com/docs/8.x/controllers#resource-controllers

Sinnbeck's avatar

Can you show your blade file, so we can see for our selves?

siangboon's avatar

no nested forms... view the rendered page source code to double check the link/action in the form

Snapey's avatar

when you get a validation error you are being redirected back with GET to the original URL

The problem is caused when you have two forms and on the completion of the first form, you return a view containing the second form.

Is this the case?

Always return a redirect at the end of a POST request, and never a view

LaravelNovice:)'s avatar

How can I send COMPACT with redirect ? I am having the same issue and tried your method also. But I need to send COMPACT also.

automica's avatar

@kumarnaresh you'd use compact if you are passing data into a blade. As you've a POST method, you need to redirect to a method that is accessible on a GET

if you want to display the record after creating it in your POST, then redirect to the GET method and pass in the id of the model you are trying to display.

LaravelNovice:)'s avatar

''' class ProjectsController extends Controller {

public function ProjectsView(){ $projects = projects::orderBy('id','ASC')->paginate(15); return view('backend.projects.projects_view',compact('projects')); }

public function BackendProjectSearch(Request $request){

$request->validate(["search" => "required"]);
$item = $request->search;		       
$projects = Projects::where('project_name','LIKE',"%$item%")->paginate(15);
return view('backend.projects.projects_view',compact('projects'));

} // end method '''

This is my controller. The method ProjectView is for view of the page with result records. Its working fine and is being called from a GET route.

The method BackendProjectSearch is required for a search field in the same page to search for specific records. Its has a POST route. When I enter some search string in the view , it works fine with the first page of filtered records. But when I click on the NEXT page link it shows the error "The GET method is not supported for this route. Supported methods: POST laravel"

Tray2's avatar

@kumarnaresh First of all you open a new thread instead of using one that is old and then to share code you use three back ticks ` to wrap the code with.

1 like
LaravelNovice:)'s avatar

I did but could not get any solution. Its there in the forum. Thanks for sharing the tip.

Please or to participate in this conversation.