GuyVerville
GuyVerville
FFilament
Created by GuyVerville on 4/27/2024 in #❓┊help
Placing a save button in the header
Hello, this is perhaps very simple to do. I haven't found in the documentation (or I didn't look carefully). Is there a way to place a save button on the top right, along with or instead of the delete button in the edit form? I think the getHeaderActions() in Edit[...].php doesn't include any such action.
5 replies
FFilament
Created by GuyVerville on 3/15/2024 in #❓┊help
I don't see where the importAction error file is.
What I am trying to do: I made an ImportAction for users. It works well. What I did: I insert existing error to check what what it should result. I receive proper notifications on screen (coded by me) My issue: I do not receive any message to where to find the error log. And why I see a message that my batch is on queue while it is already been done. How to change the message? What am I missing? My code:
class UserImporter extends Importer
{
protected static ?string $model = User::class;

public static function getColumns(): array
{
return [

[...]

];
}

protected function beforeSave(): void
{
[...]
}

protected function afterSave(): void
{
[...]
Notification::make()
->title(__('filament.invitation_transmitted') . $user->first_name . ' ' . $user->last_name . '.')
->success()
->duration(10000)
->send();
}

public function resolveRecord(): ?User
{
$user = User::query()
->where('email', $this->data['email'])
->first();

if ($user) {
Notification::make()
->title($user->email . __('filament.already_registered'))
->success()
->duration(10000)
->send();
throw new RowImportFailedException(__('filament.already_registred') . "[{$this->data['email']}].");
}

return new User();
}

public static function getCompletedNotificationBody(Import $import): string
{
[...]

return $body;
}
}
class UserImporter extends Importer
{
protected static ?string $model = User::class;

public static function getColumns(): array
{
return [

[...]

];
}

protected function beforeSave(): void
{
[...]
}

protected function afterSave(): void
{
[...]
Notification::make()
->title(__('filament.invitation_transmitted') . $user->first_name . ' ' . $user->last_name . '.')
->success()
->duration(10000)
->send();
}

public function resolveRecord(): ?User
{
$user = User::query()
->where('email', $this->data['email'])
->first();

if ($user) {
Notification::make()
->title($user->email . __('filament.already_registered'))
->success()
->duration(10000)
->send();
throw new RowImportFailedException(__('filament.already_registred') . "[{$this->data['email']}].");
}

return new User();
}

public static function getCompletedNotificationBody(Import $import): string
{
[...]

return $body;
}
}
2 replies
FFilament
Created by GuyVerville on 3/3/2024 in #❓┊help
Reordoring a table makes the edit buttons disappear
No description
2 replies