I am trying to create a new blade.php page, I need to access this page by pressing a button on my home page, but it isn't working properly.
How can I do it?
I tried doing
Route::get('/my-page', function () { return view('my-page'); });
inside web.php, it works, but when I press the card button, it doesn't work
`
<div >
<a href="{{ route('course-page') }}">
<div >
<span >
<img src="assets/image/courses.svg" >
</span>
<div >
<p >COURSES</p>
</div>
</div>
</a>
</div>
CodePudding user response:
You are trying to get a route by route name while you did not define the route name. Add a name for your route:
Route::get('/my-page', function () { return view('my-page'); })->name('course-page');
CodePudding user response:
Try this, Change in web.php
Route::get('/my-page', function () { return view('my-page'); })->name('course-page');
Welcome in advance.