Skip to content

Instantly share code, notes, and snippets.

@jvadillo
Created October 21, 2018 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvadillo/fd3168f2c2d20c7a71379e6e8c6a5834 to your computer and use it in GitHub Desktop.
Save jvadillo/fd3168f2c2d20c7a71379e6e8c6a5834 to your computer and use it in GitHub Desktop.
Named routes in laravel
// Generating URLs...
$url = route('profile');
// Generating Redirects...
return redirect()->route('profile');
$url = route('profile', ['id' => 1]);
Route::get('user/profile', function () {
//
})->name('profile');
//OR
Route::get('user/profile', 'UserProfileController@show')->name('profile');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment