Method not Allowed, but is there

Published 6 days ago by dan3460

Normally i get this type of error when trying to hit as route because of misspelling or the method is the wrong one. I have been stuck on this one for more than an hour and i do not understand what is going on. Here is the section where i set up the route:

Route::get('/tables/languageNew', '[email protected]');
Route::post('/tables/languageNew', '[email protected]');
Route::get('/tables/languageEdit/{languageID)', '[email protected]'); <-- Trying to hit this one
Route::put('/tables/languageEdit/{languageID}', '[email protected]');
Route::delete('/tables/language/{languageID}', '[email protected]');

here is the call to the route:

<td class="d-flex justify-content-between">
    <a href="/tables/languageEdit/{{$language->language_id}}" class="btn btn-sm btn-info">Edit</a>
    <form action="/tables/language/{{$language->language_id}}" method="POST">
        @csrf @method('delete')
        <button type="submit" class="btn btn-sm btn-danger">Delete</button>
    </form>
</td>

I'm calling the edit between the a tags.

and here are the headers from Chrome tools:

Request URL: http://127.0.0.1:8000/tables/languageEdit/2
Request Method: GET
Status Code: 405 Method Not Allowed
Remote Address: 127.0.0.1:8000
Referrer Policy: no-referrer-when-downgrade

What i'm not seeing? Thanks for the help,

Best Answer (As Selected By dan3460)
Snapey

Missing curly brace after languageID in your route

Snapey
Snapey
6 days ago (993,535 XP)

Missing curly brace after languageID in your route

dan3460
dan3460
6 days ago (11,100 XP)

I feel stupid!!! you are complete right.

Time to go for a drink!!

Thank you sir,

Snapey
Snapey
6 days ago (993,535 XP)

no problems. Mark it solved please

Please sign in or create an account to participate in this conversation.