User 介面 只能看資料不能做修改 Role 介面移除 Branch介面 只能看資料不能做修改 Room 介面 可操控 包廂開關台 Sqgger API 可操控API Room 有操控異動記錄 machine_statuses 需做資料留存需留7 天 20250528
63 lines
2.4 KiB
PHP
63 lines
2.4 KiB
PHP
<?php
|
|
use Illuminate\Support\Facades\Auth;
|
|
use App\Livewire\Actions\Logout;
|
|
use Livewire\Volt\Component;
|
|
|
|
new class extends Component
|
|
{
|
|
public array $menus=[
|
|
['label' => 'Dashboard', 'route' => 'admin.dashboard', 'icon' => 'home', 'permission' => null],
|
|
['label' => 'ActivityLog', 'route' => 'admin.activity-log', 'icon' => 'clock', 'permission' => null],
|
|
['label' => 'User', 'route' => 'admin.users', 'icon' => 'user-circle', 'permission' => 'user-list'],
|
|
['label' => 'Branche', 'route' => 'admin.branches', 'icon' => 'building-library', 'permission' => 'room-list'],
|
|
['label' => 'Room', 'route' => 'admin.rooms', 'icon' => 'film', 'permission' => 'room-list'],
|
|
];
|
|
|
|
/**
|
|
* Log the current user out of the application.
|
|
*/
|
|
public function logout(Logout $logout): void
|
|
{
|
|
$logout();
|
|
|
|
$this->redirect('/', navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<aside class="w-64 bg-white border-r flex flex-col justify-between h-screen">
|
|
{{-- 頂部區塊 --}}
|
|
<div>
|
|
<div class="p-4 border-b">
|
|
<div class="flex items-center justify-between">
|
|
<div class="font-bold text-lg">管理後台</div>
|
|
<div
|
|
class="inline-flex items-center px-2 py-1 text-sm font-medium text-gray-700"
|
|
x-data="{ name: '{{ auth()->user()->name }}' }"
|
|
x-text="name"
|
|
x-on:profile-updated.window="name = $event.detail.name">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- 選單 --}}
|
|
<nav class="mt-4">
|
|
@foreach ($menus as $menu)
|
|
@if (!$menu['permission'] || Auth::user()->can($menu['permission']))
|
|
<a href="{{ route($menu['route']) }}"
|
|
class="flex items-center px-4 py-2 text-gray-700 hover:bg-gray-100 {{ request()->routeIs($menu['route']) ? 'bg-gray-100 font-semibold' : '' }}">
|
|
<x-wireui:icon name="{{ $menu['icon'] }}" class="w-5 h-5 mr-2" />
|
|
{{ $menu['label'] }}
|
|
</a>
|
|
@endif
|
|
@endforeach
|
|
</nav>
|
|
</div>
|
|
|
|
{{-- 登出按鈕(固定底部) --}}
|
|
<div class="p-4 border-t">
|
|
<button wire:click="logout"
|
|
class="flex items-center text-sm text-gray-700 hover:text-red-600">
|
|
{{ __('Log Out') }}
|
|
</button>
|
|
</div>
|
|
</aside>
|