0 points

Setting up Vue in Laravel 8 - DEV


Sat Nov 21 2020 19:51:19 GMT+0000 (UTC)

Posted by @eneki

// you could use the invokable flag so you don't use the index

php artisan make:controller PagesController --invokable

// and then use this route:
Route::get('/{any?}', App\Http\Controllers\PagesController::class)->where('any', '.*');

// it tells Laravel routing to respond to any route provided or nothing with the question mark "?" and responds with an invokable controller

    public function __invoke()
        return view('welcome');
content_copy Copy