- Galerien sind nun eine Entität - es kann mehrere geben
- Neues Sparkbooth-Upload-Feature: Endpoint /api/sparkbooth/upload (Token-basiert pro Galerie), Controller Api/SparkboothUploadController, Migration 2026_01_21_000001_add_upload_fields_to_galleries_table.php mit Upload-Flags/Token/Expiry;
Galerie-Modell und Factory/Seeder entsprechend erweitert.
- Filament: Neue Setup-Seite SparkboothSetup (mit View) zur schnellen Galerie- und Token-Erstellung inkl. QR/Endpoint/Snippet;
Galerie-Link-Views nutzen jetzt simple-qrcode (Composer-Dependency hinzugefügt) und bieten PNG-Download.
- Galerie-Tabelle: Slug/Pfad-Spalten entfernt, Action „Link-Details“ mit Modal; Created-at-Spalte hinzugefügt.
- Zugriffshärtung: Galerie-IDs in API (ImageController, Download/Print) geprüft; GalleryAccess/Middleware + Gallery-Modell/Slug-UUID
eingeführt; GalleryAccess-Inertia-Seite.
- UI/UX: LoadingSpinner/StyledImageDisplay verbessert, Delete-Confirm, Übersetzungen ergänzt.
This commit is contained in:
74
app/Filament/Resources/Galleries/Schemas/GalleryForm.php
Normal file
74
app/Filament/Resources/Galleries/Schemas/GalleryForm.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Galleries\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\View;
|
||||
use Filament\Schemas\Schema;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class GalleryForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Details')
|
||||
->columns(2)
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required(),
|
||||
TextInput::make('slug')
|
||||
->label('Slug')
|
||||
->disabled()
|
||||
->dehydrated(true)
|
||||
->helperText('Wird automatisch erzeugt'),
|
||||
TextInput::make('title')
|
||||
->label('Titel')
|
||||
->required(),
|
||||
TextInput::make('images_path')
|
||||
->label('Bilder-Pfad')
|
||||
->helperText('Relativer Pfad unter public/storage')
|
||||
->required(),
|
||||
Toggle::make('is_public')
|
||||
->label('Öffentlich')
|
||||
->default(true),
|
||||
Toggle::make('allow_ai_styles')
|
||||
->label('AI-Stile erlauben')
|
||||
->default(true),
|
||||
Toggle::make('allow_print')
|
||||
->label('Drucken erlauben')
|
||||
->default(true),
|
||||
Toggle::make('require_password')
|
||||
->label('Passwortschutz aktiv')
|
||||
->default(false),
|
||||
TextInput::make('password')
|
||||
->label('Neues Passwort')
|
||||
->password()
|
||||
->revealable()
|
||||
->dehydrated(false)
|
||||
->helperText('Leer lassen, um das bestehende Passwort zu behalten.'),
|
||||
DateTimePicker::make('expires_at')
|
||||
->label('Ablaufdatum')
|
||||
->native(false)
|
||||
->seconds(false),
|
||||
TextInput::make('access_duration_minutes')
|
||||
->label('Zugriffsdauer (Minuten)')
|
||||
->numeric()
|
||||
->minValue(1)
|
||||
->nullable()
|
||||
->helperText('Optional: Zeitfenster nach dem ersten Unlock.'),
|
||||
]),
|
||||
View::make('filament.components.gallery-link')
|
||||
->columnSpanFull()
|
||||
->visible(fn (?object $record) => (bool) $record?->id)
|
||||
->viewData(fn (?object $record) => [
|
||||
'url' => $record ? URL::route('gallery.show', $record) : null,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user