Answers for "route laravel"

3

laravel route namespace and prefix

Route::prefix('admin')->group(function () {
    Route::get('/users', function () {
        // Matches The "/admin/users" URL
    });
});
Posted by: Guest on December-15-2020
0

laravel routes return view in web.php

Route::get("/page", function(){
   return View::make("dir.page");
});
Posted by: Guest on May-07-2020
5

named route with parameter laravel

Route::get('/menu/{category}/{product}/{item}', ['as' => 'named.route' , 'uses' => 'MenuController@listItem']);

// to get the actual linke
route('named.route', ['category' => $category->id, 'product' => $product->id, 'item' => $item->id]);
Posted by: Guest on May-29-2020
1

laravel route namespace and prefix

Route::name('admin.')->group(function () {
    Route::get('/users', function () {
        // Route assigned name "admin.users"...
    })->name('users');
});
Posted by: Guest on December-15-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
4

laravel route

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

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language