Custom Routes with Laravel 7
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Custom Routes with Laravel 7
As of Laravel 7 it is no longer possible to have duplicate route names: https://laravel.com/docs/7.x/upgrade#unique-route-names
The Aimeos docs recommend to add a duplicate route to overwrite the default URLs: https://aimeos.org/docs/Laravel/Custom_routes
This fails in Laravel 7 when using
What is the best practice to have custom routes with Laravel 7?
The Aimeos docs recommend to add a duplicate route to overwrite the default URLs: https://aimeos.org/docs/Laravel/Custom_routes
This fails in Laravel 7 when using
Code: Select all
php artisan optimize
Re: Custom Routes with Laravel 7
That does complicate things a bit.
You can disable the Aimeos routes for the area you want to overwrite a route for by configuration:
https://github.com/aimeos/aimeos-larave ... s.php#L181
Then, you have to add all the routes you've disabled yourself and change the one you want.
You can disable the Aimeos routes for the area you want to overwrite a route for by configuration:
https://github.com/aimeos/aimeos-larave ... s.php#L181
Then, you have to add all the routes you've disabled yourself and change the one you want.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Custom Routes with Laravel 7
I did something similar in my web.php routes file:
Maybe it's best, if one could simply "php artisan vendor:publish --tag=aimeos_routes", to expose and modify Aimeos routes. Just not sure, if this poses maintainability issues (ie if you make changes to the routes.php file on minor version changes).
Code: Select all
// Clear previous routes
$emptyRoutes = new \Illuminate\Routing\RouteCollection();
Route::setRoutes($emptyRoutes);
// Add modified content from Aimeos routes.php