Answers for "routing in laravel"

PHP
2

laravel routing techniques

Route::view('Url','PageName');
//here Url is the call word which pass from url
Route::get('Url',[Controller::class ,'FunctionName']);
//from this route you can access function of specific 
//controller thourgh specific url route
Route::get('Url/{id}',[Controller::class ,'FunctionName']);
//if you want to pass specific id or any thing thorugh route you 
//can use it{id} or{name} or {anything} means anything you want to access
Posted by: Guest on August-10-2021
3

laravel route pattern

Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
    // Only executed if {id} is numeric...
});
Posted by: Guest on May-18-2020
4

laravel basic routing

Route::get('foo', function () {
    return 'Hello World';
});
Posted by: Guest on March-10-2020
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

artisan in route in laravel

Artisan::call('cache:clear')
Posted by: Guest on May-11-2021
0

routing in laravel

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

Browse Popular Code Answers by Language