Cleanup Added lobby menu and page items. fix for root redirect

This commit is contained in:
2025-09-03 22:49:27 +02:00
parent 6e212db8e1
commit eff5aafbdb
25 changed files with 148 additions and 65 deletions

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\User\Pages;
use Filament\Pages\Page;
class AboutUs extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.user.pages.about-us';
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\User\Pages;
use Filament\Pages\Page;
class Deposits extends Page
{
protected static ?string $navigationIcon = 'iconsax-two-money-recive';
protected static string $view = 'filament.user.pages.deposits';
}

View File

@@ -6,7 +6,7 @@ use Filament\Pages\Page;
class Lobby extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-home';
protected static ?string $navigationIcon = 'ri-home-smile-2-fill';
protected static string $view = 'filament.user.pages.lobby';
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\User\Pages;
use Filament\Pages\Page;
class Profile extends Page
{
protected static ?string $navigationIcon = 'carbon-user-profile';
protected static string $view = 'filament.user.pages.profile';
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\User\Pages;
use Filament\Pages\Page;
class Transactions extends Page
{
protected static ?string $navigationIcon = 'polaris-transaction-icon';
protected static string $view = 'filament.user.pages.transactions';
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Filament\User\Pages;
use Filament\Pages\Page;
class VIP extends Page
{
protected static ?string $navigationIcon = 'ri-vip-crown-2-fill';
protected static string $view = 'filament.user.pages.v-i-p';
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Filament\User\Widgets;
use Filament\Widgets\Widget;
class AdminButtonWidget extends Widget
{
protected static ?int $sort = 1;
protected static string $view = 'filament.user.widgets.admin-button-widget';
public function shouldRender(): bool
{
return auth()->user()->role === 'admin';
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Filament\User\Widgets;
use Filament\Widgets\Widget;
class AdminLinkWidget extends Widget
{
protected static ?int $sort = 2;
protected static string $view = 'filament.user.widgets.admin-link-widget';
public function shouldRender(): bool
{
return auth()->user() && auth()->user()->role === 'admin';
}
}

View File

@@ -24,19 +24,21 @@ class UserPanelProvider extends PanelProvider
{
return $panel
->id('user')
->path('user')
->path('') // Serve at root (/)
->login()
->colors([
'primary' => Color::Green, // Neon green accents
'primary' => Color::Purple, // Purple for user panel
])
->brandLogo(null) // Text brand name only
->discoverResources(in: app_path('Filament/User/Resources'), for: 'App\\Filament\\User\\Resources')
->discoverPages(in: app_path('Filament/User/Pages'), for: 'App\\Filament\\User\\Pages')
->pages([
Pages\Dashboard::class, # Lobby as dashboard
Pages\Dashboard::class, // Lobby as dashboard
])
->discoverWidgets(in: app_path('Filament/User/Widgets'), for: 'App\\Filament\\User\\Widgets')
->widgets([
Widgets\AccountWidget::class,
\App\Filament\User\Widgets\AdminLinkWidget::class, // Correct namespace
])
->middleware([
EncryptCookies::class,
@@ -53,7 +55,8 @@ class UserPanelProvider extends PanelProvider
Authenticate::class,
])
->navigationGroups([
'Casino' # Group for games, deposits, transactions
]);
'Casino' // Group for games, deposits, transactions
])
->default();
}
}