Support the ongoing development of Laravel.io →
Views Blade Installation

Having a difficult time getting Route::has working correct.

routes.php

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

View has

@if (Route::has('login'))
      <div class="top-right links">
               <a href="{{ url('/login') }}">Login</a>
               <a href="{{ url('/register') }}">Register</a>
       </div>
@endif

I would assume with the route login created it would show the above links. It just does not show. I must be missing something..

Last updated 2 years ago.
0

You have to create a name for your routes

Route::get('login', function() {
  // code here
})->name('login');
0

OH wow, how embarrassing. Thank You.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

wolfbbs wolfbbs Joined 2 Aug 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.