S
S
Sergey Konstantinov2021-01-27 16:38:37
Laravel
Sergey Konstantinov, 2021-01-27 16:38:37

Why doesn't it show the session status in Laravel correctly?

According to this article, I made the rights to users https://laravel.demiart.ru/guide-to-roles-and-perm...
composer require laravel/ui

{{ session('status') }} - does not correctly display the session status, always writes "You are logged in!"

I did it through composer, so it should work by itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Vasilyev, 2021-01-27
@SoFuWa

For Blade templates, use the authentication facade

<div>{{ Auth::check() ? 'Hello, ' .  Auth::user()->name . '!' : 'Hello, guest!' }}</div>

And if you are going to write a SPA, then it would be better to authenticate and authorize using a JWT token, and not a session

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question