@extends('layouts.app') @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @php $user = auth()->user(); $hasRole = function (string $role) use ($user) { return $user && method_exists($user, 'hasRole') && $user->hasRole($role); }; @endphp {{-- Developer Dashboard --}} @if($user && method_exists($user, 'isDeveloper') && $user->isDeveloper()) @if(view()->exists('pages.dashboard.partials.developer')) @include('pages.dashboard.partials.developer') @endif @endif {{-- Owner Dashboard --}} @if($user && method_exists($user, 'isOwner') && $user->isOwner()) @if(view()->exists('pages.dashboard.partials.owner')) @include('pages.dashboard.partials.owner') @endif @endif {{-- SPV Dashboard --}} @if($user && method_exists($user, 'isSPV') && $user->isSPV()) @if(view()->exists('pages.dashboard.partials.spv')) @include('pages.dashboard.partials.spv') @endif @endif {{-- Designer Dashboard --}} @if($user && method_exists($user, 'isDesigner') && $user->isDesigner()) @if(view()->exists('pages.dashboard.partials.designer')) @include('pages.dashboard.partials.designer') @endif @endif {{-- Kasir Dashboard --}} @if($user && method_exists($user, 'isKasir') && $user->isKasir()) @if(view()->exists('pages.dashboard.partials.kasir')) @include('pages.dashboard.partials.kasir') @endif @endif {{-- Operator Dashboard --}} @if($user && method_exists($user, 'isOperator') && $user->isOperator()) @if(view()->exists('pages.dashboard.partials.operator')) @include('pages.dashboard.partials.operator') @endif @endif {{-- Instalasi Dashboard --}} @if($hasRole('Instalasi') || ($user && method_exists($user, 'isInstalasi') && $user->isInstalasi())) @if(view()->exists('pages.dashboard.partials.instalasi')) @include('pages.dashboard.partials.instalasi') @endif @endif {{-- Administrasi --}} @if($user && method_exists($user, 'isAdministrasi') && $user->isAdministrasi()) @if(view()->exists('pages.dashboard.partials.administrasi')) @include('pages.dashboard.partials.administrasi') @endif @endif @endsection