1

I have this problem when I try to access the page vie link it works properly. But when I try to write the route inside a link in order to access it using navbar, it throws the following Error :

Route [home] not defined. (View: C:\wamp64\www\projectName\resources\views\layouts\master.blade.php) (View: C:\wamp64\www\projectName\resources\views\layouts\master.blade.php)

And my route is as following:

Route::get('/home', function () {
return view('home');
});

This is how I write the route inside the navbar link:

{{ Route('home') }}

Any help is highly appreciated.

1 Answer 1

2

When you use named route you have to give name to that particular route. change your code to:

Route::get('/home', function () {
return view('home');
})->name('home);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.