How to use routes in web.php :
Route::get('/', function () { return view('home'); })->name('home');
How to use routes in your page.blade.php :
<a href="{{ url("/") }}">home</a>
// or
<a href="{{ route('home') }}">home</a>
// Like the post if you found it usefull and help other devs to find the good answer
// Check if route is ***
Request::route()->named("YourRouteNameView")
Route::get('/', [ControllerName::class, 'index'])->name('homeRoute');
Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
Route::get('/novanoticia', ['as' => 'route_name', 'uses' => 'HomeController@getNovaNoticia']);
Route::get('user/profile', function () {
//
})->name('profile');
Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
Route::namespace('Admin')->group(function () {
// Controllers Within The "AppHttpControllersAdmin" Namespace
});
Route::get('/user/{id}/profile', function ($id) {
//
})->name('profile');
$url = route('profile', ['id' => 1]);