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

joedoe's avatar

Inertia can do only GET Requests

Having an inertia call to a controller is working and brings me to the php code inside controller.

THIS WORKS.

<Link :href="route('permitter.create')">Action</Link>

if i use a 'delete' Call:

<Link :href="route('permitter.destroy',  props.userRollsProp )">Action</Link>

THIS routes to:

public function show(Request $request)
    {
       dd('showMe');
    }

Expection is that it routes to :

public function destroy(Request $request)
    {        
        dd($request);
    }

Why does the route fails ?

Route List:

GET|HEAD        admin/permitter ............................ permitter.index › Admin\PermitterController@index  
  POST            admin/permitter ............................ permitter.store › Admin\PermitterController@store  
  GET|HEAD        admin/permitter/create ................... permitter.create › Admin\PermitterController@create  
  GET|HEAD        admin/permitter/{permitter} .................. permitter.show › Admin\PermitterController@show  
  PUT|PATCH       admin/permitter/{permitter} .............. permitter.update › Admin\PermitterController@update  
  DELETE          admin/permitter/{permitter} ............ permitter.destroy › Admin\PermitterController@destroy  
  GET|HEAD        admin/permitter/{permitter}/edit ............. permitter.edit › Admin\PermitterController@edit
0 likes
5 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You need to actually tell inertia the type of request to do. It cannot guess it

<Link :href="route('permitter.destroy',  props.userRollsProp )" method="delete" >Action</Link>
joedoe's avatar

@Sinnbeck ty man, simple and it works.

i tryed it with and without but failed so many times. So you need it as soon you dont have a GET request.

1 like
Lumethys's avatar

@joedoe yes, and this is not unique to inertia, EVERY framework/ library out there need you to define the method

Vanilla html, vanilla JS, Jquery, Axios, Nuxt useFetch,...

if you want to send a request, you must specify its method

Sinnbeck's avatar

If this is solved, please mark a best answer

Please or to participate in this conversation.