->suffixAction(
Forms\Components\Actions\Action::make('newCategoryForAsset')
->icon('heroicon-m-squares-plus')
->form([
Forms\Components\TextInput::make('name')
->maxLength(255)
->required(),
Forms\Components\TextArea::make('note')
])
->mutateFormDataUsing(function (array $data): array {
$data['type'] = 'Asset';
$data['user_id'] = auth()->id();
return $data;
})
->successNotification(function (array $data){
Notification::make()
->title('Category registered')
->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
->success();
})
->action(function (array $data): void {
Category::create($data);
})
),
->suffixAction(
Forms\Components\Actions\Action::make('newCategoryForAsset')
->icon('heroicon-m-squares-plus')
->form([
Forms\Components\TextInput::make('name')
->maxLength(255)
->required(),
Forms\Components\TextArea::make('note')
])
->mutateFormDataUsing(function (array $data): array {
$data['type'] = 'Asset';
$data['user_id'] = auth()->id();
return $data;
})
->successNotification(function (array $data){
Notification::make()
->title('Category registered')
->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
->success();
})
->action(function (array $data): void {
Category::create($data);
})
),