Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
@@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace App\Filament\Resources\Hotel\BadgeTextEditors\Pages;
use App\Filament\Resources\Hotel\BadgeTextEditors\BadgeTextEditorResource;
use Filament\Actions\DeleteAction;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use PDOException;
class EditBadgeTextEditor extends EditRecord
{
#[\Override]
protected static string $resource = BadgeTextEditorResource::class;
#[\Override]
protected function getActions(): array
{
return [DeleteAction::make()];
}
#[\Override]
protected function mutateFormDataBeforeSave(array $data): array
{
return $data;
}
protected function afterSave(): void {}
#[\Override]
protected function handleRecordUpdate(Model $record, array $data): Model
{
try {
return parent::handleRecordUpdate($record, $data);
} catch (PDOException $e) {
if ($e->getCode() === '23000') {
Log::error('Duplicate badge key error: ' . $e->getMessage());
Notification::make()
->title('Duplicate Badge Key')
->body('The badge key already exists. Please use a unique badge key.')
->danger()
->persistent()
->send();
return $record;
}
throw $e;
}
}
}