mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-30 13:44:44 +02:00
34 lines
811 B
PHP
34 lines
811 B
PHP
<?php
|
|
|
|
namespace App\Traits\Filament;
|
|
|
|
use Filament\Resources\Pages\PageRegistration;
|
|
|
|
trait CanCustomizePages
|
|
{
|
|
/** @var array<string, PageRegistration> */
|
|
protected static array $customPages = [];
|
|
|
|
/** @param array<string, PageRegistration> $customPages */
|
|
public static function registerCustomPages(array $customPages): void
|
|
{
|
|
static::$customPages = array_merge(static::$customPages, $customPages);
|
|
}
|
|
|
|
/**
|
|
* @return array<string, PageRegistration>
|
|
*/
|
|
public static function getDefaultPages(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @return array<string, PageRegistration>
|
|
*/
|
|
public static function getPages(): array
|
|
{
|
|
return array_unique(array_merge(static::getDefaultPages(), static::$customPages), SORT_REGULAR);
|
|
}
|
|
}
|