mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
82 lines
2.0 KiB
PHP
Executable File
82 lines
2.0 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Filament\Pages;
|
|
|
|
use App\Filament\Resources\ProductResource\Actions\CreateAction;
|
|
use App\Filament\Widgets\ProductStats;
|
|
use Filament\Facades\Filament;
|
|
use Filament\Pages\Page;
|
|
use Filament\Support\Facades\FilamentIcon;
|
|
use Filament\Widgets\Widget;
|
|
use Filament\Widgets\WidgetConfiguration;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
|
|
class HomeDashboard extends Page
|
|
{
|
|
protected static string $routePath = '/';
|
|
|
|
protected static ?int $navigationSort = -2;
|
|
|
|
/**
|
|
* @var view-string
|
|
*/
|
|
protected static string $view = 'filament-panels::pages.dashboard';
|
|
|
|
public static function getNavigationLabel(): string
|
|
{
|
|
return static::$navigationLabel ??
|
|
static::$title ??
|
|
__('filament-panels::pages/dashboard.title');
|
|
}
|
|
|
|
public static function getNavigationIcon(): string|Htmlable|null
|
|
{
|
|
return static::$navigationIcon
|
|
?? FilamentIcon::resolve('panels::pages.dashboard.navigation-item')
|
|
?? (Filament::hasTopNavigation() ? 'heroicon-m-home' : 'heroicon-o-home');
|
|
}
|
|
|
|
public static function getRoutePath(): string
|
|
{
|
|
return static::$routePath;
|
|
}
|
|
|
|
/**
|
|
* @return array<class-string<Widget> | WidgetConfiguration>
|
|
*/
|
|
public function getWidgets(): array
|
|
{
|
|
return [
|
|
ProductStats::class,
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array<class-string<Widget> | WidgetConfiguration>
|
|
*/
|
|
public function getVisibleWidgets(): array
|
|
{
|
|
return $this->filterVisibleWidgets($this->getWidgets());
|
|
}
|
|
|
|
/**
|
|
* @return int | string | array<string, int | string | null>
|
|
*/
|
|
public function getColumns(): int|string|array
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
public function getTitle(): string|Htmlable
|
|
{
|
|
return static::$title ?? __('filament-panels::pages/dashboard.title');
|
|
}
|
|
|
|
public function getHeaderActions(): array
|
|
{
|
|
return [
|
|
CreateAction::make(),
|
|
];
|
|
}
|
|
}
|