Authorization Logged In or Guest

Nabeel provided the code for the authorization Logged In user and I asked on a Laravel forum about adding Guest because I am new to Laravel and basic PHP coding. So if you want to display the Logged In user or show Guest use this code in your phpVMS v7 theme:

[code}

                @if(Auth::check())
                Welcome: <font color=“#6D0C1F”> {{ Auth::user()->name }}
                @else
                Welcome: <font color=“#6D0C1F”> Guest
                @endif</font>

[/code]

I’ll fix the colors with CSS down the road for now I just cheated to make it quick. Hope this is helpful to someone.

 

And it looks like this:

 

 

I like seeing my name when logged in! Let’s me know at a glance that I am logged in! And if you are an admin and testing stuff what user you are logged in as. Been doing that a lot lately as I learn Laravel basics and phpVMS 7!

Thanks for sharing that, for those who are using PHPVMS 5.x.xx, here is a simple code to view your members online;

\<?php $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo "{$pilot-\>firstname} {$pilot-\>lastname}-{$pilot-\>rank}-{$pilot-\>location}\<br /\>"; } ?\>

This gives, 3 total viewing options, you may of course weed it down to your choices. 

On 10/21/2018 at 5:02 PM, Heritage1 said:

Thanks for sharing that, for those who are using PHPVMS 5.x.xx, here is a simple code to view your members online;

<?php $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo “{$pilot->firstname} {$pilot->lastname}-{$pilot->rank}-{$pilot->location}<br />”; } ?>

This gives, 3 total viewing options, you may of course weed it down to your choices. 

Let’s not put the older phpVMS stuff in here, I don’t want to confuse people.

Sorry about that, wasn’t thinking, I’m bad, won’t happen again 😁