xxxxxxxxxx
Route::get($uri, $callback);
Route::post($uri, $callback);
Route::put($uri, $callback);
Route::patch($uri, $callback);
Route::delete($uri, $callback);
Route::options($uri, $callback);
Route::match(['get', 'post'], '/', function () {
// ...
});
Route::any('/', function () {
// ...
});
//By default, Route::redirect returns a 302 status code. You may customize
//the status code using the optional third parameter:
Route::redirect('/here', '/there');
//you may use the Route::permanentRedirect method to return a 301 status
//code
Route::permanentRedirect('/here', '/there');
xxxxxxxxxx
function confirmDelete(id){
let url = "{{ route('getDeleteRequest', ':id') }}";
url = url.replace(':id', id);
document.location.href=url;
}
xxxxxxxxxx
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
xxxxxxxxxx
Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
xxxxxxxxxx
Route::get('user/{id}/profile', function ($id) {
//
})->name('profile');
$url = route('profile', ['id' => 1, 'photos' => 'yes']);
// /user/1/profile?photos=yes
xxxxxxxxxx
Route::view('/welcome', 'welcome');
Route::view('/welcome', 'welcome', ['name' => 'Taylor']);