mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
34 lines
843 B
PHP
34 lines
843 B
PHP
<?php
|
|
|
|
namespace App\Traits\Filament;
|
|
|
|
use App\Enums\StepPosition;
|
|
use Filament\Schemas\Components\Wizard\Step;
|
|
|
|
trait CanCustomizeSteps
|
|
{
|
|
/** @var Step[] */
|
|
protected static array $customSteps = [];
|
|
|
|
public static function registerCustomSteps(StepPosition $position, Step ...$customSteps): void
|
|
{
|
|
static::$customSteps[$position->value] = array_merge(static::$customSteps[$position->value] ?? [], $customSteps);
|
|
}
|
|
|
|
/** @return Step[] */
|
|
protected function getDefaultSteps(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/** @return Step[] */
|
|
protected function getSteps(): array
|
|
{
|
|
return array_merge(
|
|
static::$customSteps[StepPosition::Before->value] ?? [],
|
|
$this->getDefaultSteps(),
|
|
static::$customSteps[StepPosition::After->value] ?? []
|
|
);
|
|
}
|
|
}
|