From 1ac8009173eb295bf13cfd8c17fa9e368c804479 Mon Sep 17 00:00:00 2001 From: Alexander Gabriel Date: Sun, 28 Jun 2026 14:58:42 +0000 Subject: [PATCH] added photoprofile --- .../Pages/CreatePhotoprofile.php | 11 ++++ .../Photoprofiles/Pages/EditPhotoprofile.php | 19 +++++++ .../Photoprofiles/Pages/ListPhotoprofiles.php | 19 +++++++ .../Photoprofiles/PhotoprofileResource.php | 50 +++++++++++++++++++ .../Schemas/PhotoprofileForm.php | 26 ++++++++++ .../Tables/PhotoprofilesTable.php | 44 ++++++++++++++++ app/Models/Photocommand.php | 10 ---- app/Models/Photoprofile.php | 6 +-- ...6_28_133610_create_photoprofiles_table.php | 1 + 9 files changed, 173 insertions(+), 13 deletions(-) create mode 100644 app/Filament/Resources/Photoprofiles/Pages/CreatePhotoprofile.php create mode 100644 app/Filament/Resources/Photoprofiles/Pages/EditPhotoprofile.php create mode 100644 app/Filament/Resources/Photoprofiles/Pages/ListPhotoprofiles.php create mode 100644 app/Filament/Resources/Photoprofiles/PhotoprofileResource.php create mode 100644 app/Filament/Resources/Photoprofiles/Schemas/PhotoprofileForm.php create mode 100644 app/Filament/Resources/Photoprofiles/Tables/PhotoprofilesTable.php delete mode 100644 app/Models/Photocommand.php diff --git a/app/Filament/Resources/Photoprofiles/Pages/CreatePhotoprofile.php b/app/Filament/Resources/Photoprofiles/Pages/CreatePhotoprofile.php new file mode 100644 index 0000000..9dd7069 --- /dev/null +++ b/app/Filament/Resources/Photoprofiles/Pages/CreatePhotoprofile.php @@ -0,0 +1,11 @@ + ListPhotoprofiles::route('/'), + 'create' => CreatePhotoprofile::route('/create'), + 'edit' => EditPhotoprofile::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/Photoprofiles/Schemas/PhotoprofileForm.php b/app/Filament/Resources/Photoprofiles/Schemas/PhotoprofileForm.php new file mode 100644 index 0000000..0ac0c66 --- /dev/null +++ b/app/Filament/Resources/Photoprofiles/Schemas/PhotoprofileForm.php @@ -0,0 +1,26 @@ +components([ + TextInput::make('name') + ->label('Name') + ->required(), + Checkbox::make('active') + ->label('Aktiv'), + Textarea::make('commands') + ->label('Befehle') + ->required(), + ]); + } +} diff --git a/app/Filament/Resources/Photoprofiles/Tables/PhotoprofilesTable.php b/app/Filament/Resources/Photoprofiles/Tables/PhotoprofilesTable.php new file mode 100644 index 0000000..250af00 --- /dev/null +++ b/app/Filament/Resources/Photoprofiles/Tables/PhotoprofilesTable.php @@ -0,0 +1,44 @@ +columns([ + TextColumn::make('created_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + TextColumn::make('updated_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + TextColumn::make('name') + ->label('Name') + ->searchable(), + IconColumn::make('active') + ->label('Aktiv') + ]) + ->filters([ + // + ]) + ->recordActions([ + EditAction::make(), + ]) + ->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Models/Photocommand.php b/app/Models/Photocommand.php deleted file mode 100644 index b08f7b2..0000000 --- a/app/Models/Photocommand.php +++ /dev/null @@ -1,10 +0,0 @@ - 'array', - ]; + // } diff --git a/database/migrations/2026_06_28_133610_create_photoprofiles_table.php b/database/migrations/2026_06_28_133610_create_photoprofiles_table.php index e9be1c1..434df6a 100644 --- a/database/migrations/2026_06_28_133610_create_photoprofiles_table.php +++ b/database/migrations/2026_06_28_133610_create_photoprofiles_table.php @@ -14,6 +14,7 @@ return new class extends Migration Schema::create('photoprofiles', function (Blueprint $table) { $table->id(); $table->timestamps(); + $table->boolean('active')->default(1); $table->string("name"); $table->string("commands"); });