- 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:
2025-12-04 07:52:50 +01:00
parent 52dc61ca16
commit f5da8ed877
49 changed files with 2243 additions and 165 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Gallery;
use App\Services\PrinterService;
use App\Settings\GeneralSettings;
use Illuminate\Http\Request;
@@ -16,9 +17,25 @@ class PrintController extends Controller
$request->validate([
'image_path' => 'required|string',
'quantity' => 'required|integer|min:1',
'gallery' => 'required|string|exists:galleries,slug',
]);
$gallery = Gallery::where('slug', $request->string('gallery'))->firstOrFail();
if ($gallery && ! $gallery->allow_print) {
return response()->json(['error' => 'Printing is disabled for this gallery.'], 403);
}
$imagePath = public_path(str_replace(url('/'), '', $request->input('image_path')));
if (! str_contains($imagePath, DIRECTORY_SEPARATOR.trim($gallery->images_path, '/').DIRECTORY_SEPARATOR)) {
Log::warning('PrintController: Image path does not belong to gallery.', [
'gallery' => $gallery->slug,
'image_path' => $imagePath,
]);
return response()->json(['error' => 'Image file not found.'], 404);
}
$quantity = $request->input('quantity');
$printerName = $this->settings->selected_printer === '__custom__'