Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Logged in user check in laravel blade file

@php
if(Auth::check()){
$user = Auth::user();  
$user_id = $user->id;
$role_user = AppModelsRoleUser::where('user_id', $user_id)->first();
$role_name = AppModelsRole::where('id', $role_user->role_id)->first();
$role = $role_name->name;
}
@endphp
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Logged #user #check #laravel #blade #file
ADD COMMENT
Topic
Name
3+7 =