Created
October 21, 2018 11:00
-
-
Save jvadillo/fd3168f2c2d20c7a71379e6e8c6a5834 to your computer and use it in GitHub Desktop.
Named routes in laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generating URLs... | |
$url = route('profile'); | |
// Generating Redirects... | |
return redirect()->route('profile'); | |
$url = route('profile', ['id' => 1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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