Skip to content

inconsistent behavior in routes web.php file after php artisan optimize and before php artisan optimize. #53591

@rajatvermaiam

Description

@rajatvermaiam

Laravel Version

11.31.0

PHP Version

8.3.13

Database Driver & Version

No response

Description

inconsistent behavior in routes web.php file after php artisan optimize and before php artisan optimize. i am providing steps to reproduce same behavior, it will be easy to understand there.

Steps To Reproduce

in web.php suppose we have these routes like below:
Route::permanentRedirect('/', '/en'); //1st route
Route::get('en', [HomeController::class, 'homepage']); //2nd route
Route::post('/', [GetController::class, 'getMedia']); //3rd route

  1. Enter "php artisan optimize:clear" command.
  2. And submit an HTML form by " form action="{{route('download')}}" method="post" from second route. The third route is getting control.
  3. Enter "php artisan optimize" command.
  4. And submit an HTML form by " form action="{{route('download')}}" method="post" from second route.. The first route is getting control.

This is inconsistent behavior after optimize command .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions