user login status / group assignment in view

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
columbo
Advanced
Posts: 124
Joined: 09 Oct 2019, 09:42

user login status / group assignment in view

Post by columbo » 15 Oct 2019, 15:40

Hi,

how can we check in Laravel 6 if a user is already logged-in and if so, to which user groups he belongs in a view eg. in items-body-list.php?

In Laravel blade I would check the login-status with something like:

Code: Select all

@if (Auth::check())
  //show logged in detail-link
@else
  //show logged out detail-link
@endif
Thank you

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: user login status / group assignment in view

Post by aimeos » 15 Oct 2019, 15:59

You can use normal PHP statements:

Code: Select all

<?php if(Auth::check()) : ?>
  //show logged in detail-link
<?php else : ?>
  //show logged out detail-link
<?php endif ?>
The Blade compiler produces the same output.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply