skip to Main Content

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 class="col-lg-4 col-md-4 col-sm-4 my-1">
<a href="{{ route('course-page') }}">
<div class="card card-animated text-center py-5">
<span class="">
<img class="img-fluid" src="assets/image/courses.svg" >
</span>
<div class="card-body">
<p class="card-text">COURSES</p>
</div>
</div>
</a>
</div>

2

Answers


  1. 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');
    
    Login or Signup to reply.
  2. Try this,
    Change in web.php

    Route::get('/my-page', function () { return view('my-page'); })->name('course-page');
    

    Welcome in advance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search