Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38
    jacob_smith
    Participant

    I am new in Laravel Breeze and I see this code in the welcome.blade.php file.

    @if (Route::has(‘login’))
    <div>

    </div>
    @endif

    What does the code do?

    #43

    Route::has(‘login’) basically checks in the routes list if a route with a name ‘login’ exists. If it does it returns true, otherwise it returns false.

    If you check on routes/auth.php you would see this code on the file

    Route::get(‘login’, [AuthenticatedSessionController::class, ‘create’])
    ->name(‘login’);

    This means with a fresh installation of Laravel Breeze, this named route is made by default so that if statement would return true.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.