php - How can I set a catch all route as the very last route in Laravel -
i'm building basic cms seo slugs, want catch @ end of routes slug. @ end of routes file added:
route::get('/{page?}', ['as' => 'page', 'middleware' => 'web', 'uses' => 'pagecontroller@index']);
which works fine, until added laravel file manager, has routes of own. these routes added after of routes in main routes file. catch picks meant file manager.
how can load other routes, including in other vendor folders, before running catch all? there way can state route must not match route prefixed laravel-filemanager
? i've not been able find on in laravel documentation or through google.
as requested here app providers:
'providers' => [ /* * laravel framework service providers... */ illuminate\auth\authserviceprovider::class, illuminate\broadcasting\broadcastserviceprovider::class, illuminate\bus\busserviceprovider::class, illuminate\cache\cacheserviceprovider::class, illuminate\foundation\providers\consolesupportserviceprovider::class, illuminate\cookie\cookieserviceprovider::class, illuminate\database\databaseserviceprovider::class, illuminate\encryption\encryptionserviceprovider::class, illuminate\filesystem\filesystemserviceprovider::class, illuminate\foundation\providers\foundationserviceprovider::class, illuminate\hashing\hashserviceprovider::class, illuminate\mail\mailserviceprovider::class, illuminate\pagination\paginationserviceprovider::class, illuminate\pipeline\pipelineserviceprovider::class, illuminate\queue\queueserviceprovider::class, illuminate\redis\redisserviceprovider::class, illuminate\auth\passwords\passwordresetserviceprovider::class, illuminate\session\sessionserviceprovider::class, illuminate\translation\translationserviceprovider::class, illuminate\validation\validationserviceprovider::class, illuminate\view\viewserviceprovider::class, /* * application service providers... */ app\providers\appserviceprovider::class, app\providers\authserviceprovider::class, app\providers\eventserviceprovider::class, app\providers\routeserviceprovider::class, barryvdh\laravelidehelper\idehelperserviceprovider::class, caffeinated\modules\modulesserviceprovider::class, intervention\image\imageserviceprovider::class, spatie\activitylog\activitylogserviceprovider::class, spatie\permission\permissionserviceprovider::class, unisharp\ckeditor\serviceprovider::class, unisharp\laravelfilemanager\laravelfilemanagerserviceprovider::class, ],
simply try reorder service providers in app.php this:
'providers' => [ /* * laravel framework service providers... */ unisharp\laravelfilemanager\laravelfilemanagerserviceprovider::class, ... app\providers\routeserviceprovider::class, ... ],
anyway write routeserviceprovider
@ end of list, if not special case
Comments
Post a Comment