taxonomy create/edit redirect

This commit is contained in:
xiaomlove
2022-11-09 21:56:03 +08:00
parent b92b911b1e
commit 6479f0a799
17 changed files with 105 additions and 20 deletions
@@ -9,4 +9,20 @@ use Filament\Resources\Pages\CreateRecord;
class CreateCodec extends CreateRecord
{
protected static string $resource = CodecResource::class;
public function afterCreate()
{
clear_search_box_cache();
$model = static::$resource::getModel();
$table = (new $model)->getTable();
clear_taxonomy_cache($table);
}
protected function mutateFormDataBeforeCreate(array $data): array
{
if ($data['mode'] === null) {
$data['mode'] = 0;
}
return $data;
}
}