это моя проблема. file1: вошли в систему пользователи
<?php
//this file is to save and reuse logged in user info's in dashboard pages.
// General
$CurrentUser = Auth::user();
$Role = $CurrentUser->role()->value('RoleName');
$CurrentUser->Mode = 'ON';
$CurrentUser->save();
$UserFullName = $CurrentUser->FirstName . ' ' . $CurrentUser->LastName;
$UserStatus = $CurrentUser->Status;
$UserMode = $CurrentUser->Mode;
$Menus = MenuPicker($CurrentUser);
// for admin badges
$allNewRegisteredOrders = AllNewRegisteredOrders();
$employmentRequest = NewEmployment();
$OnlineUsers = OnlineUsers();
$SiteVisitors = GetSiteVisitors(1);
// for customer badges
$CustomerRegisteredOrders = CustomerRegisteredOrders($CurrentUser->id);
$CustomerInvoices = CustomerInvoices($CurrentUser->id);
file 2: dashboard
@extends('auth.DashboardLayout.DashboardMasterLayout')
@section('content')
@include('script.DashboardLoggedInUser')
@switch($CurrentUser->role()->value('id'))
{{--=============================== ِ Admin =======================================--}}
@case(1)
@section('Title',$Role)
@include('DashboardAdminIndex')
@break
это часть моего кода, но я не могу использовать это $CurrentUser
в панели инструментов. любая идея будет оценена спасибо.