2022-10-27 20:21:54 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Filament\Resources\Section\IconResource\Pages;
|
|
|
|
|
|
2022-12-01 00:45:22 +08:00
|
|
|
use App\Filament\EditRedirectIndexTrait;
|
2022-10-27 20:21:54 +08:00
|
|
|
use App\Filament\Resources\Section\IconResource;
|
|
|
|
|
use Filament\Pages\Actions;
|
|
|
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
|
|
|
|
|
|
class EditIcon extends EditRecord
|
|
|
|
|
{
|
2022-12-01 00:45:22 +08:00
|
|
|
use EditRedirectIndexTrait;
|
2022-11-14 19:02:42 +08:00
|
|
|
|
2022-10-27 20:21:54 +08:00
|
|
|
protected static string $resource = IconResource::class;
|
|
|
|
|
|
2025-02-06 22:32:36 +08:00
|
|
|
// protected static string $view = 'filament.resources.system.category-icon-resource.pages.edit-record';
|
2022-10-27 20:21:54 +08:00
|
|
|
|
2024-12-25 23:09:07 +08:00
|
|
|
protected function getHeaderActions(): array
|
2022-10-27 20:21:54 +08:00
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
Actions\DeleteAction::make(),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-06 22:32:36 +08:00
|
|
|
protected function mutateFormDataBeforeFill(array $data): array
|
|
|
|
|
{
|
|
|
|
|
$data['tip'] = nexus_trans('label.icon.desc');
|
|
|
|
|
return $data;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 20:21:54 +08:00
|
|
|
protected function getViewData(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'desc' => nexus_trans('label.icon.desc')
|
|
|
|
|
];
|
|
|
|
|
}
|
2023-02-06 14:25:05 +08:00
|
|
|
|
|
|
|
|
public function afterSave()
|
|
|
|
|
{
|
|
|
|
|
clear_icon_cache();
|
|
|
|
|
}
|
2022-10-27 20:21:54 +08:00
|
|
|
}
|