Answers for "laraval routing"

PHP
5

route() and with() in laravel

Route::get('user/{id}/profile', function ($id) {
    //
})->name('profile');

$url = route('profile', ['id' => 1, 'photos' => 'yes']);

// /user/1/profile?photos=yes
Posted by: Guest on May-30-2020
1

laraval routing

use App\Http\Controllers\UserController;
use App\Models\User;

// Route definition...
Route::get('/users/{user}', [UserController::class, 'show']);

// Controller method definition...
public function show(User $user)
{
    return view('user.profile', ['user' => $user]);
}
Posted by: Guest on January-15-2021
3

laravel route

Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});
Posted by: Guest on April-22-2020
1

laraval routing

Route::redirect('/here', '/there', 301);
Posted by: Guest on January-15-2021
0

routing in laravel

Route::view('/welcome', 'welcome');
Route::view('/welcome', 'welcome', ['name' => 'Taylor']);
Posted by: Guest on July-05-2020
0

laraval routing

Route::redirect('/here', '/there');
Posted by: Guest on January-15-2021

Browse Popular Code Answers by Language