I'm building a basic CMS with SEO slugs, so I want a catch all at the end of my routes to get the slug. So at the end of my routes file I added:
Route::get('/{page?}', ['as' => 'Page', 'middleware' => 'web', 'uses' => 'PageController@index']);
Which works fine, until I added Laravel File Manager, which has routes of its own. These routes are added after all of the routes in my main routes file. So now my catch all picks up anything meant for the file manager.
How can I load all other routes, including those in other vendor folders, before running the catch all? Is there a way I can state that the route must not match any route prefixed with laravel-filemanager
? I've not been able to find anything on this in the Laravel documentation or through Google.
As requested here is my 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,
],