Closed sc-delanoderooij closed 2 years ago
Describe the bug
When one registers a route with a prefix and the route:cache command has been executed then the registered route uri becomes malformed; the prefix is duplicated and the locale is gone.
Steps to Reproduce
Register prefixed route
Route::prefix('prefix')->group(function() { Route::multilingual('/test-route', fn() => 'Test Route') ->name('test-route'); });
php artisan route:cache php artisan route:list --name=test-route
Reproduction output
php artisan route:list --name=test-route +--------+----------+----------------------+---------------+---------+------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+----------+----------------------+---------------+---------+------------+ | | GET|HEAD | en/prefix/test-route | en.test-route | Closure | | | | GET|HEAD | fr/prefix/test-route | fr.test-route | Closure | | | | GET|HEAD | nl/prefix/test-route | nl.test-route | Closure | | | | GET|HEAD | sv/prefix/test-route | sv.test-route | Closure | | +--------+----------+----------------------+---------------+---------+------------+
php artisan route:cache Route cache cleared! Routes cached successfully!
php artisan route:list --name=test-route +--------+----------+--------------------------+---------------+---------+------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+----------+--------------------------+---------------+---------+------------+ | | GET|HEAD | prefix/prefix/test-route | nl.test-route | Closure | | | | GET|HEAD | prefix/prefix/test-route | en.test-route | Closure | | | | GET|HEAD | prefix/prefix/test-route | fr.test-route | Closure | | | | GET|HEAD | prefix/prefix/test-route | sv.test-route | Closure | | +--------+----------+--------------------------+---------------+---------+------------+
php artisan route:clear Route cache cleared!
Additional context
PHP 8.1 Laravel 8.X Branch v2
This is fixed as of v2.8.2.
Describe the bug
When one registers a route with a prefix and the route:cache command has been executed then the registered route uri becomes malformed; the prefix is duplicated and the locale is gone.
Steps to Reproduce
Register prefixed route
Reproduction output
Additional context
PHP 8.1 Laravel 8.X Branch v2