mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 03:05:01 +02:00
56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\TableActions\Storage\Base;
|
|
|
|
use App\Actions\Storage\Base\PruneAction as BasePruneAction;
|
|
use App\Filament\TableActions\Storage\StorageTableAction;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Form;
|
|
|
|
/**
|
|
* Class PruneTableAction.
|
|
*/
|
|
abstract class PruneTableAction extends StorageTableAction
|
|
{
|
|
/**
|
|
* Initial setup for the action.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->icon(__('filament.table_actions.base.prune.icon'));
|
|
}
|
|
|
|
/**
|
|
* Get the fields available on the action.
|
|
*
|
|
* @param Form $form
|
|
* @return Form
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public function getForm(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
TextInput::make('hours')
|
|
->label(__('filament.actions.storage.prune.fields.hours.name'))
|
|
->helperText(__('filament.actions.storage.prune.fields.hours.help'))
|
|
->numeric(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Get the underlying storage action.
|
|
*
|
|
* @param array $fields
|
|
* @return BasePruneAction
|
|
*/
|
|
abstract protected function storageAction(array $fields): BasePruneAction;
|
|
}
|