Laravel 5 conditional routing and multiple controllers
问题 So basically my app has two types of dynamic url.. app.com/{page} app.com/{user} Both having their own controllers PageController@index User\ProfileController@index But I'm struggling to get this working. I have tried a few different methods. Here are two I have tried.. Route::get('{slug}', function($slug) { if (App\Page::where('slug', $slug)->count()) { // return redirect()->action('PageController@index', [$slug]); // return App::make('App\Http\Controllers\PageController', [$slug])->index();