Skip to content

Instantly share code, notes, and snippets.

@chrisblackwell
Created September 6, 2015 01:38
Show Gist options
  • Save chrisblackwell/c0978f3b62c52c2f8cbc to your computer and use it in GitHub Desktop.
Save chrisblackwell/c0978f3b62c52c2f8cbc to your computer and use it in GitHub Desktop.
Laravel Catch-All Route
Route::group(['middleware' => 'auth'], function () {
Route::get('{view}', function ($view) {
try {
return view($view);
} catch (\Exception $e) {
abort(404);
}
})->where('view', '.*');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment