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

I'm trying to use Auth functionality.

The problem is that if in my view i have the following code:

<ul>
@if(Auth::check())
    <li>{{ HTML::route('profile', 'Profile' ) }}</li>
    <li>{{ HTML::route('logout', 'Logout ('.Auth::user()->username.')') }}</li>
@else
    <li>{{ HTML::route('login', 'Login') }}</li>
@endif
</ul>

The auth is not performed.

This is the result of the above code in the browser:

Result

Any hint?

Last updated 3 years ago.
0

Looks like you aren't using the .blade.php extension. The file wont use the Blade engine if your extension is .php.

Either rename your file to XX.blade.php or use <?php ... ?> tags for your PHP code.

Last updated 3 years ago.
0

Wow.. It works!

It was an inclusion file in my layout and I forgot to use Blade extension!

You saved my time, thank you so much Marwelln!

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

rox85 rox85 Joined 14 Apr 2014

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.