laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.62k stars 11.03k forks source link

Strange routing issue only on Apache httpd 2.4.62 #53605

Closed gslongo closed 1 day ago

gslongo commented 1 day ago

Laravel Version

10.48.24

PHP Version

8.1.30

Database Driver & Version

mariadb-10.5.22-1.el9_2.x86_64

Description

Hi !

I'm struggling on a strange issue. I implemented a DELETE method on my app. It works well using the php artisan serve web server however it doesn't work on Apache httpd-2.4.62-1.el9.x86_64 (Rocky Linux 9)

The request is properly sent by the browser but I get a redirect : image

Request content ;

image

image

Response : image

As you can see the error is The GET method is not supported for route admin/events/1/delete. Supported methods: POST. in file /var/www/html/XXXXXXXX/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php on line 122

However, it's a POST request !

I tried to clear routes cache and so on.. Without any success

Steps To Reproduce

my web.php is :

` Route::prefix('/admin')->middleware('auth')->controller(App\Http\Controllers\AdminEventsController::class)->group(function () { Route::get('/', 'index')->name('admin.index'); Route::get('/users', 'users')->name('admin.users'); Route::post('/users/create', 'createUser')->name('admin.users.create'); Route::get('/users/{id}', 'user')->name('admin.user'); Route::get('/users/{id}/edit', 'editUser')->name('admin.users.edit'); Route::put('/users/{id}/update', 'updateUser')->name('admin.users.update'); Route::delete('/users/{id}/delete', 'deleteUser')->name('admin.users.delete'); Route::get('/events', 'events')->name('admin.events'); Route::get('/events/{id}', 'event')->name('admin.event'); Route::get('/events/{id}/edit', 'editEvent')->name('admin.editEvent'); Route::put('/events/{id}/update', 'updateEvent')->name('admin.events.update'); Route::delete('/events/{id}/delete', 'deleteEvent')->name('admin.deleteEvent'); Route::post('/events/create', 'createEvent')->name('admin.createEvent'); Route::get('/events/{id}/speciales', 'speciales')->name('admin.speciales'); Route::get('/events/{id}/speciales/{speciale}', 'speciale')->name('admin.speciale'); Route::get('/speciale/{speciale}/edit', 'editSpeciale')->name('admin.speciale.edit'); Route::put('/speciale/{speciale}/update', 'updateSpeciale')->name('admin.speciale.update'); Route::delete('/speciale/{speciale}/delete', 'deleteSpeciale')->name('admin.speciale.delete'); Route::post('/speciale/{evenement}/create', 'createSpeciale')->name('admin.speciale.create');

});`

crynobone commented 1 day ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question which may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repository you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.