diff --git a/app/Console/Commands/AttachDemoEvent.php b/app/Console/Commands/AttachDemoEvent.php index 7e80d48..a58086d 100644 --- a/app/Console/Commands/AttachDemoEvent.php +++ b/app/Console/Commands/AttachDemoEvent.php @@ -7,7 +7,6 @@ use App\Models\Tenant; use App\Models\User; use Illuminate\Console\Attributes\AsCommand; use Illuminate\Console\Command; -use Illuminate\Support\Facades\DB; #[AsCommand(name: 'tenant:attach-demo-event')] class AttachDemoEvent extends Command @@ -25,10 +24,12 @@ class AttachDemoEvent extends Command { if (! \Illuminate\Support\Facades\Schema::hasTable('events')) { $this->error("Table 'events' does not exist. Run: php artisan migrate"); + return self::FAILURE; } if (! \Illuminate\Support\Facades\Schema::hasColumn('events', 'tenant_id')) { $this->error("Column 'events.tenant_id' does not exist. Add it and rerun. Suggested: create a migration to add a nullable foreignId to tenants."); + return self::FAILURE; } $tenant = null; @@ -45,6 +46,7 @@ class AttachDemoEvent extends Command } if (! $tenant) { $this->error('Tenant not found. Provide --tenant-slug or a user with tenant_id via --tenant-email.'); + return self::FAILURE; } @@ -67,12 +69,14 @@ class AttachDemoEvent extends Command if (! $event) { $this->error('Event not found. Provide --event-id or --event-slug.'); + return self::FAILURE; } // Idempotent update if ((int) $event->tenant_id === (int) $tenant->id) { $this->info("Event #{$event->id} already attached to tenant #{$tenant->id} ({$tenant->slug})."); + return self::SUCCESS; } @@ -80,6 +84,7 @@ class AttachDemoEvent extends Command $event->save(); $this->info("Attached event #{$event->id} ({$event->slug}) to tenant #{$tenant->id} ({$tenant->slug})."); + return self::SUCCESS; } } diff --git a/app/Console/Commands/BackfillThumbnails.php b/app/Console/Commands/BackfillThumbnails.php index fb8846f..7503092 100644 --- a/app/Console/Commands/BackfillThumbnails.php +++ b/app/Console/Commands/BackfillThumbnails.php @@ -10,22 +10,27 @@ use Illuminate\Support\Facades\Storage; class BackfillThumbnails extends Command { protected $signature = 'media:backfill-thumbnails {--limit=500}'; + protected $description = 'Generate thumbnails for photos missing thumbnail_path or where thumbnail equals original.'; public function handle(): int { $limit = (int) $this->option('limit'); $rows = DB::table('photos') - ->select(['id','event_id','file_path','thumbnail_path']) + ->select(['id', 'event_id', 'file_path', 'thumbnail_path']) ->orderBy('id') ->limit($limit) ->get(); $count = 0; foreach ($rows as $r) { - $orig = $this->relativeFromUrl((string)$r->file_path); - $thumb = (string)($r->thumbnail_path ?? ''); - if ($thumb && $thumb !== $r->file_path) continue; // already set to different thumb - if (! $orig) continue; + $orig = $this->relativeFromUrl((string) $r->file_path); + $thumb = (string) ($r->thumbnail_path ?? ''); + if ($thumb && $thumb !== $r->file_path) { + continue; + } // already set to different thumb + if (! $orig) { + continue; + } $baseName = pathinfo($orig, PATHINFO_FILENAME); $destRel = "events/{$r->event_id}/photos/thumbs/{$baseName}_thumb.jpg"; $made = ImageHelper::makeThumbnailOnDisk('public', $orig, $destRel, 640, 82); @@ -39,6 +44,7 @@ class BackfillThumbnails extends Command } } $this->info("Done. Thumbnails generated: {$count}"); + return self::SUCCESS; } @@ -49,6 +55,7 @@ class BackfillThumbnails extends Command if (str_starts_with($p, '/storage/')) { return substr($p, strlen('/storage/')); } + return null; } } diff --git a/app/Console/Commands/MigrateLegacyPurchases.php b/app/Console/Commands/MigrateLegacyPurchases.php index 243e130..8d34b3d 100644 --- a/app/Console/Commands/MigrateLegacyPurchases.php +++ b/app/Console/Commands/MigrateLegacyPurchases.php @@ -4,15 +4,15 @@ namespace App\Console\Commands; use App\Models\PackagePurchase; use App\Models\Tenant; -use App\Models\User; use App\Models\TenantPackage; +use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Facades\DB; class MigrateLegacyPurchases extends Command { protected $signature = 'packages:migrate-legacy'; + protected $description = 'Migrate legacy purchases to new system with temp tenants'; public function handle() @@ -21,19 +21,20 @@ class MigrateLegacyPurchases extends Command if ($legacyPurchases->isEmpty()) { $this->info('No legacy purchases found.'); + return 0; } $this->info("Found {$legacyPurchases->count()} legacy purchases."); foreach ($legacyPurchases as $purchase) { - if (!$purchase->user_id) { + if (! $purchase->user_id) { // Create temp user if no user $tempUser = User::create([ - 'name' => 'Legacy User ' . $purchase->id, - 'email' => 'legacy' . $purchase->id . '@fotospiel.local', + 'name' => 'Legacy User '.$purchase->id, + 'email' => 'legacy'.$purchase->id.'@fotospiel.local', 'password' => Hash::make('legacy'), - 'username' => 'legacy' . $purchase->id, + 'username' => 'legacy'.$purchase->id, 'first_name' => 'Legacy', 'last_name' => 'User', 'address' => 'Legacy Address', @@ -43,7 +44,7 @@ class MigrateLegacyPurchases extends Command $tempTenant = Tenant::create([ 'user_id' => $tempUser->id, - 'name' => 'Legacy Tenant ' . $purchase->id, + 'name' => 'Legacy Tenant '.$purchase->id, 'status' => 'active', ]); @@ -73,6 +74,7 @@ class MigrateLegacyPurchases extends Command } $this->info('Legacy migration completed.'); + return 0; } -} \ No newline at end of file +} diff --git a/app/Console/Commands/SendAbandonedCheckoutReminders.php b/app/Console/Commands/SendAbandonedCheckoutReminders.php index 856b5ea..d45895c 100644 --- a/app/Console/Commands/SendAbandonedCheckoutReminders.php +++ b/app/Console/Commands/SendAbandonedCheckoutReminders.php @@ -62,7 +62,7 @@ class SendAbandonedCheckoutReminders extends Command if ($this->shouldSendReminder($checkout, $stage)) { $resumeUrl = $this->generateResumeUrl($checkout); - if (!$isDryRun) { + if (! $isDryRun) { $mailLocale = $checkout->user->preferred_locale ?? config('app.locale'); Mail::to($checkout->user) @@ -86,8 +86,8 @@ class SendAbandonedCheckoutReminders extends Command $totalProcessed++; } } catch (Throwable $e) { - Log::error("Failed to send {$stage} reminder for checkout {$checkout->id}: " . $e->getMessage()); - $this->error(" ❌ Failed to process checkout {$checkout->id}: " . $e->getMessage()); + Log::error("Failed to send {$stage} reminder for checkout {$checkout->id}: ".$e->getMessage()); + $this->error(" ❌ Failed to process checkout {$checkout->id}: ".$e->getMessage()); } } } @@ -98,7 +98,7 @@ class SendAbandonedCheckoutReminders extends Command ->count(); if ($oldCheckouts > 0) { - if (!$isDryRun) { + if (! $isDryRun) { AbandonedCheckoutModel::where('abandoned_at', '<', now()->subDays(30)) ->where('converted', false) ->delete(); @@ -108,10 +108,10 @@ class SendAbandonedCheckoutReminders extends Command } } - $this->info("✅ Reminder process completed!"); + $this->info('✅ Reminder process completed!'); $this->info(" Processed: {$totalProcessed} checkouts"); - if (!$isDryRun) { + if (! $isDryRun) { $this->info(" Sent: {$totalSent} reminder emails"); } else { $this->info(" Would send: {$totalSent} reminder emails"); @@ -131,12 +131,12 @@ class SendAbandonedCheckoutReminders extends Command } // User existiert noch? - if (!$checkout->user) { + if (! $checkout->user) { return false; } // Package existiert noch? - if (!$checkout->package) { + if (! $checkout->package) { return false; } diff --git a/app/Enums/PackageType.php b/app/Enums/PackageType.php index e3dbdc8..300b47a 100644 --- a/app/Enums/PackageType.php +++ b/app/Enums/PackageType.php @@ -6,4 +6,4 @@ enum PackageType: string { case ENDCUSTOMER = 'endcustomer'; case RESELLER = 'reseller'; -} \ No newline at end of file +} diff --git a/app/Exports/EventPurchaseExporter.php b/app/Exports/EventPurchaseExporter.php index 822a2da..a7283f0 100644 --- a/app/Exports/EventPurchaseExporter.php +++ b/app/Exports/EventPurchaseExporter.php @@ -5,8 +5,6 @@ namespace App\Exports; use App\Models\EventPurchase; use Filament\Actions\Exports\Exporter; use Filament\Actions\Exports\Models\Export; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Support\Collection; class EventPurchaseExporter extends Exporter { @@ -28,11 +26,10 @@ class EventPurchaseExporter extends Exporter ]; } - public static function getCompletedNotificationBody(Export $export): string { $body = "Your Event Purchases export has completed and is ready for download. {$export->successful_rows} purchases were exported."; return $body; } -} \ No newline at end of file +} diff --git a/app/Filament/Blog/Resources/CategoryResource/Pages/ListCategories.php b/app/Filament/Blog/Resources/CategoryResource/Pages/ListCategories.php index 7da37af..664fc49 100644 --- a/app/Filament/Blog/Resources/CategoryResource/Pages/ListCategories.php +++ b/app/Filament/Blog/Resources/CategoryResource/Pages/ListCategories.php @@ -16,4 +16,4 @@ class ListCategories extends ListRecords Actions\CreateAction::make(), ]; } -} \ No newline at end of file +} diff --git a/app/Filament/Blog/Resources/PostResource/Pages/ListPosts.php b/app/Filament/Blog/Resources/PostResource/Pages/ListPosts.php index a854595..723b229 100644 --- a/app/Filament/Blog/Resources/PostResource/Pages/ListPosts.php +++ b/app/Filament/Blog/Resources/PostResource/Pages/ListPosts.php @@ -16,4 +16,4 @@ class ListPosts extends ListRecords Actions\CreateAction::make(), ]; } -} \ No newline at end of file +} diff --git a/app/Filament/Blog/Resources/PostResource/Pages/ViewPost.php b/app/Filament/Blog/Resources/PostResource/Pages/ViewPost.php index d3792e6..4b671d6 100644 --- a/app/Filament/Blog/Resources/PostResource/Pages/ViewPost.php +++ b/app/Filament/Blog/Resources/PostResource/Pages/ViewPost.php @@ -8,4 +8,4 @@ use Filament\Resources\Pages\ViewRecord; class ViewPost extends ViewRecord { protected static string $resource = PostResource::class; -} \ No newline at end of file +} diff --git a/app/Filament/Blog/Traits/HasContentEditor.php b/app/Filament/Blog/Traits/HasContentEditor.php index 9700d86..1e8230e 100644 --- a/app/Filament/Blog/Traits/HasContentEditor.php +++ b/app/Filament/Blog/Traits/HasContentEditor.php @@ -26,4 +26,4 @@ trait HasContentEditor 'h3', ])); } -} \ No newline at end of file +} diff --git a/app/Filament/Resources/EmotionResource/Pages/ImportEmotions.php b/app/Filament/Resources/EmotionResource/Pages/ImportEmotions.php index cb5d2a9..c1fb210 100644 --- a/app/Filament/Resources/EmotionResource/Pages/ImportEmotions.php +++ b/app/Filament/Resources/EmotionResource/Pages/ImportEmotions.php @@ -13,7 +13,9 @@ use Illuminate\Support\Facades\Storage; class ImportEmotions extends Page { protected static string $resource = EmotionResource::class; + protected string $view = 'filament.resources.emotion-resource.pages.import-emotions'; + protected ?string $heading = null; public ?string $file = null; @@ -36,6 +38,7 @@ class ImportEmotions extends Page $path = $this->form->getState()['file'] ?? null; if (! $path || ! Storage::disk('public')->exists($path)) { Notification::make()->danger()->title(__('admin.notifications.file_not_found'))->send(); + return; } diff --git a/app/Filament/Resources/EventPurchaseResource/Pages/ListEventPurchases.php b/app/Filament/Resources/EventPurchaseResource/Pages/ListEventPurchases.php index 1433772..5d3b3e3 100644 --- a/app/Filament/Resources/EventPurchaseResource/Pages/ListEventPurchases.php +++ b/app/Filament/Resources/EventPurchaseResource/Pages/ListEventPurchases.php @@ -16,4 +16,4 @@ class ListEventPurchases extends ListRecords Actions\CreateAction::make(), ]; } -} \ No newline at end of file +} diff --git a/app/Filament/Resources/EventResource.php b/app/Filament/Resources/EventResource.php index 452fbb7..bfb519b 100644 --- a/app/Filament/Resources/EventResource.php +++ b/app/Filament/Resources/EventResource.php @@ -65,14 +65,15 @@ class EventResource extends Resource ->required(), Select::make('event_type_id') ->label(__('admin.events.fields.type')) - ->options(EventType::query()->pluck('name', 'id')) + ->options(fn () => EventType::all()->pluck('name.de', 'id')) ->searchable(), Select::make('package_id') ->label(__('admin.events.fields.package')) ->options(\App\Models\Package::query()->where('type', 'endcustomer')->pluck('name', 'id')) ->searchable() ->preload() - ->required(), + ->required() + ->visibleOn('create'), TextInput::make('default_locale') ->label(__('admin.events.fields.default_locale')) ->default('de') diff --git a/app/Filament/Resources/EventResource/Pages/CreateEvent.php b/app/Filament/Resources/EventResource/Pages/CreateEvent.php index cdc509a..e05053d 100644 --- a/app/Filament/Resources/EventResource/Pages/CreateEvent.php +++ b/app/Filament/Resources/EventResource/Pages/CreateEvent.php @@ -8,4 +8,25 @@ use App\Filament\Resources\Pages\AuditedCreateRecord; class CreateEvent extends AuditedCreateRecord { protected static string $resource = EventResource::class; + + public ?int $packageId = null; + + protected function mutateFormDataBeforeCreate(array $data): array + { + $this->packageId = $data['package_id'] ?? null; + unset($data['package_id']); + + return $data; + } + + protected function afterCreate(): void + { + if ($this->packageId) { + $this->record->eventPackages()->create([ + 'package_id' => $this->packageId, + ]); + } + + parent::afterCreate(); + } } diff --git a/app/Filament/Resources/EventResource/RelationManagers/EventPackagesRelationManager.php b/app/Filament/Resources/EventResource/RelationManagers/EventPackagesRelationManager.php index b5bfcea..6d277fc 100644 --- a/app/Filament/Resources/EventResource/RelationManagers/EventPackagesRelationManager.php +++ b/app/Filament/Resources/EventResource/RelationManagers/EventPackagesRelationManager.php @@ -19,7 +19,6 @@ use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\Relation; class EventPackagesRelationManager extends RelationManager { @@ -59,6 +58,7 @@ class EventPackagesRelationManager extends RelationManager public function table(Table $table): Table { return $table + ->modifyQueryUsing(fn (Builder $query) => $query->with('package')) ->recordTitleAttribute('package.name') ->columns([ TextColumn::make('package.name') @@ -147,9 +147,4 @@ class EventPackagesRelationManager extends RelationManager { return __('admin.events.relation_managers.event_packages.title'); } - - public function getTableQuery(): Builder|Relation - { - return parent::getTableQuery()->with('package'); - } } diff --git a/app/Filament/Resources/EventTypeResource.php b/app/Filament/Resources/EventTypeResource.php index 28f8115..9226b2a 100644 --- a/app/Filament/Resources/EventTypeResource.php +++ b/app/Filament/Resources/EventTypeResource.php @@ -113,18 +113,64 @@ class EventTypeResource extends Resource SuperAdminAuditLogger::fieldsMetadata($data), static::class )), + Actions\DeleteAction::make() + ->action(function (EventType $record, Actions\DeleteAction $action) { + try { + $record->delete(); + } catch (\Exception $e) { + $isConstraint = ($e instanceof \Illuminate\Database\QueryException && ($e->getCode() == 23000 || ($e->errorInfo[0] ?? '') == 23000)); + + if ($isConstraint) { + \Filament\Notifications\Notification::make() + ->title(__('admin.common.error')) + ->body(__('admin.event_types.messages.delete_constraint_error')) + ->danger() + ->send(); + + $action->halt(); + } + + throw $e; + } + }) + ->after(fn (EventType $record) => app(SuperAdminAuditLogger::class)->recordModelMutation( + 'deleted', + $record, + source: static::class + )), ]) ->bulkActions([ Actions\DeleteBulkAction::make() - ->after(function (Collection $records): void { + ->action(function (Collection $records, Actions\DeleteBulkAction $action) { $logger = app(SuperAdminAuditLogger::class); + $deletedCount = 0; + $failedCount = 0; foreach ($records as $record) { - $logger->recordModelMutation( - 'deleted', - $record, - source: static::class - ); + try { + $record->delete(); + $logger->recordModelMutation('deleted', $record, source: static::class); + $deletedCount++; + } catch (\Exception $e) { + $isConstraint = ($e instanceof \Illuminate\Database\QueryException && ($e->getCode() == 23000 || ($e->errorInfo[0] ?? '') == 23000)); + if ($isConstraint) { + $failedCount++; + } else { + throw $e; + } + } + } + + if ($failedCount > 0) { + \Filament\Notifications\Notification::make() + ->title(__('admin.common.error')) + ->body(__('admin.event_types.messages.delete_constraint_error')." ($failedCount failed, $deletedCount deleted)") + ->danger() + ->send(); + + if ($deletedCount === 0) { + $action->halt(); + } } }), ]); diff --git a/app/Filament/Resources/MediaStorageTargetResource/Pages/ListMediaStorageTargets.php b/app/Filament/Resources/MediaStorageTargetResource/Pages/ListMediaStorageTargets.php index 1255b95..cfe7d91 100644 --- a/app/Filament/Resources/MediaStorageTargetResource/Pages/ListMediaStorageTargets.php +++ b/app/Filament/Resources/MediaStorageTargetResource/Pages/ListMediaStorageTargets.php @@ -17,4 +17,3 @@ class ListMediaStorageTargets extends ListRecords ]; } } - diff --git a/app/Filament/Resources/PackageResource/Pages/ListPackages.php b/app/Filament/Resources/PackageResource/Pages/ListPackages.php index 148b169..821f87b 100644 --- a/app/Filament/Resources/PackageResource/Pages/ListPackages.php +++ b/app/Filament/Resources/PackageResource/Pages/ListPackages.php @@ -16,4 +16,4 @@ class ListPackages extends ListRecords Actions\CreateAction::make(), ]; } -} \ No newline at end of file +} diff --git a/app/Filament/Resources/PurchaseHistoryResource/Pages/ListPurchaseHistories.php b/app/Filament/Resources/PurchaseHistoryResource/Pages/ListPurchaseHistories.php index b8552f1..e63ffc4 100644 --- a/app/Filament/Resources/PurchaseHistoryResource/Pages/ListPurchaseHistories.php +++ b/app/Filament/Resources/PurchaseHistoryResource/Pages/ListPurchaseHistories.php @@ -14,4 +14,3 @@ class ListPurchaseHistories extends ListRecords return []; } } - diff --git a/app/Filament/Resources/PurchaseHistoryResource/Pages/ViewPurchaseHistory.php b/app/Filament/Resources/PurchaseHistoryResource/Pages/ViewPurchaseHistory.php index 2bc9342..af9d76e 100644 --- a/app/Filament/Resources/PurchaseHistoryResource/Pages/ViewPurchaseHistory.php +++ b/app/Filament/Resources/PurchaseHistoryResource/Pages/ViewPurchaseHistory.php @@ -14,4 +14,3 @@ class ViewPurchaseHistory extends ViewRecord return []; } } - diff --git a/app/Filament/Resources/PurchaseResource/Pages/ListPurchases.php b/app/Filament/Resources/PurchaseResource/Pages/ListPurchases.php index 1196f63..2ec20b8 100644 --- a/app/Filament/Resources/PurchaseResource/Pages/ListPurchases.php +++ b/app/Filament/Resources/PurchaseResource/Pages/ListPurchases.php @@ -16,4 +16,4 @@ class ListPurchases extends ListRecords Actions\CreateAction::make(), ]; } -} \ No newline at end of file +} diff --git a/app/Filament/SuperAdmin/Pages/Auth/EditProfile.php b/app/Filament/SuperAdmin/Pages/Auth/EditProfile.php index 1d58f45..17c32a1 100644 --- a/app/Filament/SuperAdmin/Pages/Auth/EditProfile.php +++ b/app/Filament/SuperAdmin/Pages/Auth/EditProfile.php @@ -3,8 +3,8 @@ namespace App\Filament\SuperAdmin\Pages\Auth; use Filament\Auth\Pages\EditProfile as BaseEditProfile; -use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Select; +use Filament\Forms\Components\TextInput; use Filament\Schemas\Schema; use Illuminate\Support\Facades\Log; @@ -38,4 +38,4 @@ class EditProfile extends BaseEditProfile $this->getCurrentPasswordFormComponent(), ]); } -} \ No newline at end of file +} diff --git a/app/Filament/Widgets/PlatformStatsWidget.php b/app/Filament/Widgets/PlatformStatsWidget.php index b59f1ec..24ba3af 100644 --- a/app/Filament/Widgets/PlatformStatsWidget.php +++ b/app/Filament/Widgets/PlatformStatsWidget.php @@ -4,8 +4,8 @@ namespace App\Filament\Widgets; use Filament\Widgets\StatsOverviewWidget as BaseWidget; use Filament\Widgets\StatsOverviewWidget\Stat; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\DB; class PlatformStatsWidget extends BaseWidget { diff --git a/app/Filament/Widgets/RevenueTrendWidget.php b/app/Filament/Widgets/RevenueTrendWidget.php index 5db69ed..55bcc74 100644 --- a/app/Filament/Widgets/RevenueTrendWidget.php +++ b/app/Filament/Widgets/RevenueTrendWidget.php @@ -7,7 +7,6 @@ use Filament\Widgets\LineChartWidget; class RevenueTrendWidget extends LineChartWidget { - protected static ?int $sort = 1; protected int|string|array $columnSpan = 'full'; diff --git a/app/Filament/Widgets/TopTenantsByUploads.php b/app/Filament/Widgets/TopTenantsByUploads.php index 004b302..de7ddce 100644 --- a/app/Filament/Widgets/TopTenantsByUploads.php +++ b/app/Filament/Widgets/TopTenantsByUploads.php @@ -2,9 +2,9 @@ namespace App\Filament\Widgets; +use App\Models\Tenant; use Filament\Tables; use Filament\Widgets\TableWidget as BaseWidget; -use App\Models\Tenant; class TopTenantsByUploads extends BaseWidget { @@ -14,6 +14,7 @@ class TopTenantsByUploads extends BaseWidget { return __('admin.widgets.top_tenants_by_uploads.heading'); } + protected ?string $pollingInterval = '60s'; public function table(Tables\Table $table): Tables\Table @@ -33,4 +34,3 @@ class TopTenantsByUploads extends BaseWidget ->paginated(false); } } - diff --git a/app/Http/Controllers/Admin/QrController.php b/app/Http/Controllers/Admin/QrController.php index 03ada90..8024b55 100644 --- a/app/Http/Controllers/Admin/QrController.php +++ b/app/Http/Controllers/Admin/QrController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers\Admin; -use Illuminate\Routing\Controller as BaseController; use Illuminate\Http\Request; +use Illuminate\Routing\Controller as BaseController; use SimpleSoftwareIO\QrCode\Facades\QrCode; class QrController extends BaseController @@ -15,7 +15,7 @@ class QrController extends BaseController return response('missing data', 400); } $png = QrCode::format('png')->size(300)->generate($data); + return response($png, 200, ['Content-Type' => 'image/png']); } } - diff --git a/app/Http/Controllers/Api/LegalController.php b/app/Http/Controllers/Api/LegalController.php index 0e208a7..14031a6 100644 --- a/app/Http/Controllers/Api/LegalController.php +++ b/app/Http/Controllers/Api/LegalController.php @@ -26,11 +26,11 @@ class LegalController extends BaseController 'allow_unsafe_links' => false, ]); - $environment->addExtension(new CommonMarkCoreExtension()); - $environment->addExtension(new TableExtension()); - $environment->addExtension(new AutolinkExtension()); - $environment->addExtension(new StrikethroughExtension()); - $environment->addExtension(new TaskListExtension()); + $environment->addExtension(new CommonMarkCoreExtension); + $environment->addExtension(new TableExtension); + $environment->addExtension(new AutolinkExtension); + $environment->addExtension(new StrikethroughExtension); + $environment->addExtension(new TaskListExtension); $this->markdown = new MarkdownConverter($environment); } diff --git a/app/Http/Controllers/Api/Tenant/EventAnalyticsController.php b/app/Http/Controllers/Api/Tenant/EventAnalyticsController.php index 80353bd..bb41887 100644 --- a/app/Http/Controllers/Api/Tenant/EventAnalyticsController.php +++ b/app/Http/Controllers/Api/Tenant/EventAnalyticsController.php @@ -7,7 +7,6 @@ use App\Models\Event; use App\Services\Analytics\EventAnalyticsService; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -use Illuminate\Support\Arr; class EventAnalyticsController extends Controller { @@ -23,13 +22,13 @@ class EventAnalyticsController extends Controller if (is_string($packageFeatures)) { $packageFeatures = json_decode($packageFeatures, true) ?? []; } - + $hasAccess = in_array('advanced_analytics', $packageFeatures, true); - if (!$hasAccess) { - return response()->json([ + if (! $hasAccess) { + return response()->json([ 'message' => 'This feature is only available in the Premium package.', - 'code' => 'feature_locked' + 'code' => 'feature_locked', ], 403); } diff --git a/app/Http/Controllers/Api/Tenant/FontController.php b/app/Http/Controllers/Api/Tenant/FontController.php index 3359815..35d111d 100644 --- a/app/Http/Controllers/Api/Tenant/FontController.php +++ b/app/Http/Controllers/Api/Tenant/FontController.php @@ -112,4 +112,3 @@ class FontController extends Controller return $fonts; } } - diff --git a/app/Http/Controllers/Api/Tenant/PhotoboothController.php b/app/Http/Controllers/Api/Tenant/PhotoboothController.php index d5d5eed..af1fb74 100644 --- a/app/Http/Controllers/Api/Tenant/PhotoboothController.php +++ b/app/Http/Controllers/Api/Tenant/PhotoboothController.php @@ -91,14 +91,14 @@ class PhotoboothController extends Controller $recipientName = $user->fullName ?? $user->name ?? $user->email; $mail = (new PhotoboothUploaderDownload( - recipientName: $recipientName, - eventName: $eventName, - links: [ - 'windows' => url('/downloads/PhotoboothUploader-win-x64.exe'), - 'macos' => url('/downloads/PhotoboothUploader-macos-x64'), - 'linux' => url('/downloads/PhotoboothUploader-linux-x64'), - ], - ))->locale($locale); + recipientName: $recipientName, + eventName: $eventName, + links: [ + 'windows' => url('/downloads/PhotoboothUploader-win-x64.exe'), + 'macos' => url('/downloads/PhotoboothUploader-macos-x64'), + 'linux' => url('/downloads/PhotoboothUploader-linux-x64'), + ], + ))->locale($locale); Mail::to($user->email)->queue($mail); diff --git a/app/Http/Controllers/LegalPageController.php b/app/Http/Controllers/LegalPageController.php index ccaecdb..41eb5cc 100644 --- a/app/Http/Controllers/LegalPageController.php +++ b/app/Http/Controllers/LegalPageController.php @@ -69,7 +69,7 @@ class LegalPageController extends Controller $effectiveFrom = optional($page->effective_from); return Inertia::render('legal/Show', [ - 'seoTitle' => $title . ' - ' . config('app.name', 'Fotospiel'), + 'seoTitle' => $title.' - '.config('app.name', 'Fotospiel'), 'title' => $title, 'content' => $this->convertMarkdownToHtml($bodyMarkdown), 'effectiveFrom' => $effectiveFrom ? $effectiveFrom->toDateString() : null, @@ -112,11 +112,11 @@ class LegalPageController extends Controller 'allow_unsafe_links' => false, ]); - $environment->addExtension(new CommonMarkCoreExtension()); - $environment->addExtension(new TableExtension()); - $environment->addExtension(new AutolinkExtension()); - $environment->addExtension(new StrikethroughExtension()); - $environment->addExtension(new TaskListExtension()); + $environment->addExtension(new CommonMarkCoreExtension); + $environment->addExtension(new TableExtension); + $environment->addExtension(new AutolinkExtension); + $environment->addExtension(new StrikethroughExtension); + $environment->addExtension(new TaskListExtension); $converter = new MarkdownConverter($environment); diff --git a/app/Http/Controllers/Tenant/EventPhotoArchiveController.php b/app/Http/Controllers/Tenant/EventPhotoArchiveController.php index 32fb71e..ada58ec 100644 --- a/app/Http/Controllers/Tenant/EventPhotoArchiveController.php +++ b/app/Http/Controllers/Tenant/EventPhotoArchiveController.php @@ -35,7 +35,7 @@ class EventPhotoArchiveController extends Controller abort(404, 'No approved photos available for this event.'); } - $zip = new ZipArchive(); + $zip = new ZipArchive; $tempPath = tempnam(sys_get_temp_dir(), 'fotospiel-photos-'); if ($tempPath === false || $zip->open($tempPath, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== true) { @@ -129,4 +129,3 @@ class EventPhotoArchiveController extends Controller return false; } } - diff --git a/app/Http/Middleware/SetLocale.php b/app/Http/Middleware/SetLocale.php index f56c0ef..b01935c 100644 --- a/app/Http/Middleware/SetLocale.php +++ b/app/Http/Middleware/SetLocale.php @@ -21,7 +21,7 @@ class SetLocale $sessionLocale = Session::get('locale', 'de'); // Fallback to Accept-Language header if no session - if (!in_array($sessionLocale, $supportedLocales)) { + if (! in_array($sessionLocale, $supportedLocales)) { $acceptLanguage = $request->header('Accept-Language', 'de'); $localeFromHeader = substr($acceptLanguage, 0, 2); $sessionLocale = in_array($localeFromHeader, $supportedLocales) ? $localeFromHeader : 'de'; diff --git a/app/Http/Middleware/SetLocaleFromRequest.php b/app/Http/Middleware/SetLocaleFromRequest.php index dcbf574..7f7467d 100644 --- a/app/Http/Middleware/SetLocaleFromRequest.php +++ b/app/Http/Middleware/SetLocaleFromRequest.php @@ -2,11 +2,11 @@ namespace App\Http\Middleware; +use App\Support\LocaleConfig; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Session; -use App\Support\LocaleConfig; class SetLocaleFromRequest { diff --git a/app/Http/Middleware/SetLocaleFromUser.php b/app/Http/Middleware/SetLocaleFromUser.php index 99f4757..8fa8cc0 100644 --- a/app/Http/Middleware/SetLocaleFromUser.php +++ b/app/Http/Middleware/SetLocaleFromUser.php @@ -19,4 +19,3 @@ class SetLocaleFromUser return $next($request); } } - diff --git a/app/Http/Requests/Settings/ProfileUpdateRequest.php b/app/Http/Requests/Settings/ProfileUpdateRequest.php index 7014415..52f2c69 100644 --- a/app/Http/Requests/Settings/ProfileUpdateRequest.php +++ b/app/Http/Requests/Settings/ProfileUpdateRequest.php @@ -57,8 +57,3 @@ class ProfileUpdateRequest extends FormRequest ]; } } - - - - - diff --git a/app/Http/Requests/Tenant/PhotoStoreRequest.php b/app/Http/Requests/Tenant/PhotoStoreRequest.php index 27ff0e5..bd47ac8 100644 --- a/app/Http/Requests/Tenant/PhotoStoreRequest.php +++ b/app/Http/Requests/Tenant/PhotoStoreRequest.php @@ -3,7 +3,6 @@ namespace App\Http\Requests\Tenant; use Illuminate\Foundation\Http\FormRequest; -use Illuminate\Validation\Rule; class PhotoStoreRequest extends FormRequest { @@ -59,4 +58,4 @@ class PhotoStoreRequest extends FormRequest 'tags' => $this->tags ? explode(',', $this->tags) : [], ]); } -} \ No newline at end of file +} diff --git a/app/Http/Requests/Tenant/SettingsStoreRequest.php b/app/Http/Requests/Tenant/SettingsStoreRequest.php index dafc294..2f9236e 100644 --- a/app/Http/Requests/Tenant/SettingsStoreRequest.php +++ b/app/Http/Requests/Tenant/SettingsStoreRequest.php @@ -88,4 +88,3 @@ class SettingsStoreRequest extends FormRequest ]); } } - diff --git a/app/Http/Resources/Tenant/CreditLedgerResource.php b/app/Http/Resources/Tenant/CreditLedgerResource.php index d12219c..1f1d403 100644 --- a/app/Http/Resources/Tenant/CreditLedgerResource.php +++ b/app/Http/Resources/Tenant/CreditLedgerResource.php @@ -18,4 +18,4 @@ class CreditLedgerResource extends JsonResource 'created_at' => $this->created_at->toISOString(), ]; } -} \ No newline at end of file +} diff --git a/app/Http/Resources/Tenant/EmotionResource.php b/app/Http/Resources/Tenant/EmotionResource.php index 0841fde..46a62d4 100644 --- a/app/Http/Resources/Tenant/EmotionResource.php +++ b/app/Http/Resources/Tenant/EmotionResource.php @@ -59,6 +59,7 @@ class EmotionResource extends JsonResource } $first = reset($value); + return $first !== false ? (string) $first : $fallback; } } diff --git a/app/Http/Resources/Tenant/EventPurchaseResource.php b/app/Http/Resources/Tenant/EventPurchaseResource.php index 1416c48..66e27a3 100644 --- a/app/Http/Resources/Tenant/EventPurchaseResource.php +++ b/app/Http/Resources/Tenant/EventPurchaseResource.php @@ -21,4 +21,4 @@ class EventPurchaseResource extends JsonResource 'created_at' => $this->created_at->toISOString(), ]; } -} \ No newline at end of file +} diff --git a/app/Jobs/ArchiveEventMediaAssets.php b/app/Jobs/ArchiveEventMediaAssets.php index 9c07af2..33b9f37 100644 --- a/app/Jobs/ArchiveEventMediaAssets.php +++ b/app/Jobs/ArchiveEventMediaAssets.php @@ -31,6 +31,7 @@ class ArchiveEventMediaAssets implements ShouldQueue if (! $event) { Log::warning('Archive job aborted: event missing', ['event_id' => $this->eventId]); + return; } @@ -38,6 +39,7 @@ class ArchiveEventMediaAssets implements ShouldQueue if (! $archiveDisk) { Log::warning('Archive job aborted: no archive disk configured', ['event_id' => $event->id]); + return; } diff --git a/app/Jobs/Concerns/LogsTenantNotifications.php b/app/Jobs/Concerns/LogsTenantNotifications.php index 393ce34..259c6b6 100644 --- a/app/Jobs/Concerns/LogsTenantNotifications.php +++ b/app/Jobs/Concerns/LogsTenantNotifications.php @@ -2,12 +2,12 @@ namespace App\Jobs\Concerns; +use App\Models\Tenant; use App\Models\TenantNotificationLog; use App\Models\TenantNotificationReceipt; -use App\Models\Tenant; use App\Services\Packages\TenantNotificationLogger; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Log; trait LogsTenantNotifications { diff --git a/app/Mail/AbandonedCheckout.php b/app/Mail/AbandonedCheckout.php index 8243515..7e530bd 100644 --- a/app/Mail/AbandonedCheckout.php +++ b/app/Mail/AbandonedCheckout.php @@ -26,7 +26,7 @@ class AbandonedCheckout extends Mailable public function envelope(): Envelope { return new Envelope( - subject: __('emails.abandoned_checkout.subject_' . $this->timing, [ + subject: __('emails.abandoned_checkout.subject_'.$this->timing, [ 'package' => $this->localizedPackageName(), ]), ); diff --git a/app/Mail/ContactConfirmation.php b/app/Mail/ContactConfirmation.php index ac5831f..2af2686 100644 --- a/app/Mail/ContactConfirmation.php +++ b/app/Mail/ContactConfirmation.php @@ -13,9 +13,7 @@ class ContactConfirmation extends Mailable use Queueable; use SerializesModels; - public function __construct(public string $name) - { - } + public function __construct(public string $name) {} public function envelope(): Envelope { diff --git a/app/Models/AbandonedCheckout.php b/app/Models/AbandonedCheckout.php index a843999..53e7096 100644 --- a/app/Models/AbandonedCheckout.php +++ b/app/Models/AbandonedCheckout.php @@ -75,11 +75,11 @@ class AbandonedCheckout extends Model public function scopeReadyForReminder($query, string $stage, int $hours) { return $query->where('reminder_stage', '!=', $stage) - ->where('reminder_stage', '!=', 'converted') - ->where('abandoned_at', '<=', now()->subHours($hours)) - ->where(function ($q) { - $q->whereNull('reminded_at') - ->orWhere('reminded_at', '<=', now()->subHours(24)); - }); + ->where('reminder_stage', '!=', 'converted') + ->where('abandoned_at', '<=', now()->subHours($hours)) + ->where(function ($q) { + $q->whereNull('reminded_at') + ->orWhere('reminded_at', '<=', now()->subHours(24)); + }); } } diff --git a/app/Models/BlogAuthor.php b/app/Models/BlogAuthor.php index e8508fe..bcafee7 100644 --- a/app/Models/BlogAuthor.php +++ b/app/Models/BlogAuthor.php @@ -19,4 +19,4 @@ class BlogAuthor extends Model 'github_handle', 'twitter_handle', ]; -} \ No newline at end of file +} diff --git a/app/Models/BlogCategory.php b/app/Models/BlogCategory.php index f9f7c9a..46e4296 100644 --- a/app/Models/BlogCategory.php +++ b/app/Models/BlogCategory.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Support\Facades\Log; class BlogCategory extends Model { @@ -42,4 +41,4 @@ class BlogCategory extends Model { return $query->where('is_visible', false); } -} \ No newline at end of file +} diff --git a/app/Models/BlogPost.php b/app/Models/BlogPost.php index aba12de..0508f0e 100644 --- a/app/Models/BlogPost.php +++ b/app/Models/BlogPost.php @@ -8,19 +8,18 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Support\Facades\Storage; -use Spatie\Translatable\HasTranslations; use League\CommonMark\Environment\Environment; -use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; -use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\Extension\Autolink\AutolinkExtension; +use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\Extension\Strikethrough\StrikethroughExtension; +use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\Extension\TaskList\TaskListExtension; use League\CommonMark\MarkdownConverter; +use Spatie\Translatable\HasTranslations; class BlogPost extends Model { - use HasFactory, SoftDeletes, HasTranslations; + use HasFactory, HasTranslations, SoftDeletes; protected $table = 'blog_posts'; @@ -78,14 +77,15 @@ class BlogPost extends Model return Attribute::get(function () { $markdown = $this->getTranslation('content', app()->getLocale()); - $environment = new Environment(); - $environment->addExtension(new CommonMarkCoreExtension()); - $environment->addExtension(new TableExtension()); - $environment->addExtension(new AutolinkExtension()); - $environment->addExtension(new StrikethroughExtension()); - $environment->addExtension(new TaskListExtension()); + $environment = new Environment; + $environment->addExtension(new CommonMarkCoreExtension); + $environment->addExtension(new TableExtension); + $environment->addExtension(new AutolinkExtension); + $environment->addExtension(new StrikethroughExtension); + $environment->addExtension(new TaskListExtension); $converter = new MarkdownConverter($environment); + return (string) $converter->convert($markdown); }); } diff --git a/app/Models/BlogTag.php b/app/Models/BlogTag.php index da2057e..6bd938c 100644 --- a/app/Models/BlogTag.php +++ b/app/Models/BlogTag.php @@ -3,14 +3,13 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Spatie\Tags\Tag; use Spatie\Translatable\HasTranslations; class BlogTag extends Tag { - use HasFactory, SoftDeletes, HasTranslations; + use HasFactory, HasTranslations, SoftDeletes; protected $translatable = [ 'name', @@ -20,4 +19,4 @@ class BlogTag extends Tag 'slug', 'translations', ]; -} \ No newline at end of file +} diff --git a/app/Models/Emotion.php b/app/Models/Emotion.php index 639fd03..4afc6b9 100644 --- a/app/Models/Emotion.php +++ b/app/Models/Emotion.php @@ -13,7 +13,9 @@ class Emotion extends Model use HasFactory; protected $table = 'emotions'; + protected $guarded = []; + protected $casts = [ 'name' => 'array', 'description' => 'array', @@ -34,4 +36,3 @@ class Emotion extends Model return $this->hasMany(Task::class); } } - diff --git a/app/Models/EventJoinTokenEvent.php b/app/Models/EventJoinTokenEvent.php index 02ab728..6c04868 100644 --- a/app/Models/EventJoinTokenEvent.php +++ b/app/Models/EventJoinTokenEvent.php @@ -47,4 +47,3 @@ class EventJoinTokenEvent extends Model return $this->belongsTo(Tenant::class); } } - diff --git a/app/Models/EventMediaAsset.php b/app/Models/EventMediaAsset.php index a2afbaf..dc851ad 100644 --- a/app/Models/EventMediaAsset.php +++ b/app/Models/EventMediaAsset.php @@ -51,4 +51,3 @@ class EventMediaAsset extends Model return $this->belongsTo(Photo::class); } } - diff --git a/app/Models/EventPurchase.php b/app/Models/EventPurchase.php index 7d98bc4..3889182 100644 --- a/app/Models/EventPurchase.php +++ b/app/Models/EventPurchase.php @@ -11,7 +11,9 @@ class EventPurchase extends Model use HasFactory; protected $table = 'event_purchases'; + protected $guarded = []; + protected $casts = [ 'purchased_at' => 'datetime', 'amount' => 'decimal:2', @@ -21,4 +23,4 @@ class EventPurchase extends Model { return $this->belongsTo(Tenant::class); } -} \ No newline at end of file +} diff --git a/app/Models/EventStorageAssignment.php b/app/Models/EventStorageAssignment.php index 707bff9..a78e09d 100644 --- a/app/Models/EventStorageAssignment.php +++ b/app/Models/EventStorageAssignment.php @@ -36,4 +36,3 @@ class EventStorageAssignment extends Model return $this->belongsTo(MediaStorageTarget::class, 'media_storage_target_id'); } } - diff --git a/app/Models/EventType.php b/app/Models/EventType.php index 4354835..25e6d34 100644 --- a/app/Models/EventType.php +++ b/app/Models/EventType.php @@ -12,7 +12,9 @@ class EventType extends Model use HasFactory; protected $table = 'event_types'; + protected $guarded = []; + protected $casts = [ 'name' => 'array', 'settings' => 'array', @@ -28,4 +30,3 @@ class EventType extends Model return $this->hasMany(Event::class); } } - diff --git a/app/Models/LegalPage.php b/app/Models/LegalPage.php index 4d73afb..67d1ad6 100644 --- a/app/Models/LegalPage.php +++ b/app/Models/LegalPage.php @@ -7,7 +7,9 @@ use Illuminate\Database\Eloquent\Model; class LegalPage extends Model { protected $table = 'legal_pages'; + protected $guarded = []; + protected $casts = [ 'title' => 'array', 'body_markdown' => 'array', @@ -15,4 +17,3 @@ class LegalPage extends Model 'effective_from' => 'datetime', ]; } - diff --git a/app/Models/MediaStorageTarget.php b/app/Models/MediaStorageTarget.php index a6d0624..2d0506f 100644 --- a/app/Models/MediaStorageTarget.php +++ b/app/Models/MediaStorageTarget.php @@ -63,4 +63,3 @@ class MediaStorageTarget extends Model return array_merge($base, $config); } } - diff --git a/app/Models/PhotoLike.php b/app/Models/PhotoLike.php index d4c801e..e20b6d0 100644 --- a/app/Models/PhotoLike.php +++ b/app/Models/PhotoLike.php @@ -8,11 +8,13 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class PhotoLike extends Model { protected $table = 'photo_likes'; + protected $guarded = []; + public $timestamps = false; public function photo(): BelongsTo { return $this->belongsTo(Photo::class); } -} \ No newline at end of file +} diff --git a/app/Models/PurchaseHistory.php b/app/Models/PurchaseHistory.php index df67353..539dab2 100644 --- a/app/Models/PurchaseHistory.php +++ b/app/Models/PurchaseHistory.php @@ -11,8 +11,11 @@ class PurchaseHistory extends Model use HasFactory; protected $table = 'purchase_history'; + public $timestamps = false; + public $incrementing = false; + protected $keyType = 'string'; protected $guarded = []; @@ -28,4 +31,3 @@ class PurchaseHistory extends Model return $this->belongsTo(Tenant::class); } } - diff --git a/app/Services/Analytics/EventAnalyticsService.php b/app/Services/Analytics/EventAnalyticsService.php index 96931df..99ea54c 100644 --- a/app/Services/Analytics/EventAnalyticsService.php +++ b/app/Services/Analytics/EventAnalyticsService.php @@ -3,7 +3,6 @@ namespace App\Services\Analytics; use App\Models\Event; -use App\Models\Photo; use Illuminate\Support\Facades\DB; class EventAnalyticsService @@ -17,7 +16,7 @@ class EventAnalyticsService // Adjust for timezone if necessary, but for now we'll use UTC or server time // Ideally we should use the event's timezone if stored, or client's. // We'll return data in ISO format buckets. - + $stats = $event->photos() ->selectRaw('DATE_FORMAT(created_at, "%Y-%m-%d %H:00:00") as hour, count(*) as count') ->groupBy('hour') diff --git a/app/Services/Analytics/JoinTokenAnalyticsRecorder.php b/app/Services/Analytics/JoinTokenAnalyticsRecorder.php index 0fe47d2..49a3f76 100644 --- a/app/Services/Analytics/JoinTokenAnalyticsRecorder.php +++ b/app/Services/Analytics/JoinTokenAnalyticsRecorder.php @@ -5,7 +5,6 @@ namespace App\Services\Analytics; use App\Models\EventJoinToken; use App\Models\EventJoinTokenEvent; use Illuminate\Http\Request; -use Illuminate\Support\Arr; use Illuminate\Support\Str; class JoinTokenAnalyticsRecorder @@ -109,4 +108,3 @@ class JoinTokenAnalyticsRecorder return Str::substr($token, 0, 6).'…'.Str::substr($token, -4); } } - diff --git a/app/Services/EmotionImportService.php b/app/Services/EmotionImportService.php index d3e80b5..1b1f7eb 100644 --- a/app/Services/EmotionImportService.php +++ b/app/Services/EmotionImportService.php @@ -19,6 +19,7 @@ class EmotionImportService $headers = fgetcsv($handle, 0, ','); if (! $headers) { fclose($handle); + return [0, 0]; } diff --git a/app/Services/Security/PhotoSecurityScanner.php b/app/Services/Security/PhotoSecurityScanner.php index 44ab2aa..b3213d3 100644 --- a/app/Services/Security/PhotoSecurityScanner.php +++ b/app/Services/Security/PhotoSecurityScanner.php @@ -192,4 +192,3 @@ class PhotoSecurityScanner } } } - diff --git a/app/Services/Storage/EventStorageManager.php b/app/Services/Storage/EventStorageManager.php index 45abcc0..50a5871 100644 --- a/app/Services/Storage/EventStorageManager.php +++ b/app/Services/Storage/EventStorageManager.php @@ -8,8 +8,6 @@ use App\Models\EventStorageAssignment; use App\Models\MediaStorageTarget; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Log; -use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Str; class EventStorageManager { diff --git a/app/Services/Storage/StorageHealthService.php b/app/Services/Storage/StorageHealthService.php index c9e7b41..ec62729 100644 --- a/app/Services/Storage/StorageHealthService.php +++ b/app/Services/Storage/StorageHealthService.php @@ -60,4 +60,3 @@ class StorageHealthService } } } - diff --git a/app/Support/LocaleConfig.php b/app/Support/LocaleConfig.php index 17bfafd..775ecf5 100644 --- a/app/Support/LocaleConfig.php +++ b/app/Support/LocaleConfig.php @@ -9,6 +9,7 @@ class LocaleConfig { /** * Return configured locales from env/config as provided (may include region codes). + * * @return array */ public static function configured(): array @@ -34,6 +35,7 @@ class LocaleConfig /** * Return normalized short codes (language only, lowercase). + * * @return array */ public static function normalized(): array diff --git a/config/filament-blog.php b/config/filament-blog.php index 07622e0..58f5738 100644 --- a/config/filament-blog.php +++ b/config/filament-blog.php @@ -66,8 +66,8 @@ return [ 'h1', 'h2', 'h3', - //'hr', - //'image', + // 'hr', + // 'image', 'italic', 'link', 'orderedList', diff --git a/config/security.php b/config/security.php index 7980a75..a1a2c32 100644 --- a/config/security.php +++ b/config/security.php @@ -14,4 +14,3 @@ return [ 'name' => env('SECURITY_SCAN_QUEUE', 'media-security'), ], ]; - diff --git a/database/factories/EmotionFactory.php b/database/factories/EmotionFactory.php index 4e51578..23258e0 100644 --- a/database/factories/EmotionFactory.php +++ b/database/factories/EmotionFactory.php @@ -29,4 +29,3 @@ class EmotionFactory extends Factory ]; } } - diff --git a/database/factories/EventFactory.php b/database/factories/EventFactory.php index 1f434a0..661e2d0 100644 --- a/database/factories/EventFactory.php +++ b/database/factories/EventFactory.php @@ -64,4 +64,3 @@ class EventFactory extends Factory ]); } } - diff --git a/database/factories/EventTypeFactory.php b/database/factories/EventTypeFactory.php index 1aad7fc..e3d0cb1 100644 --- a/database/factories/EventTypeFactory.php +++ b/database/factories/EventTypeFactory.php @@ -28,4 +28,3 @@ class EventTypeFactory extends Factory ]; } } - diff --git a/database/factories/PurchaseHistoryFactory.php b/database/factories/PurchaseHistoryFactory.php index b260427..0328a7c 100644 --- a/database/factories/PurchaseHistoryFactory.php +++ b/database/factories/PurchaseHistoryFactory.php @@ -25,4 +25,3 @@ class PurchaseHistoryFactory extends Factory ]; } } - diff --git a/database/factories/TaskCollectionFactory.php b/database/factories/TaskCollectionFactory.php index 1b3c632..736a878 100644 --- a/database/factories/TaskCollectionFactory.php +++ b/database/factories/TaskCollectionFactory.php @@ -3,7 +3,6 @@ namespace Database\Factories; use App\Models\EventType; -use App\Models\Task; use App\Models\TaskCollection; use App\Models\Tenant; use Illuminate\Database\Eloquent\Factories\Factory; @@ -21,7 +20,7 @@ class TaskCollectionFactory extends Factory return [ 'tenant_id' => Tenant::factory(), 'event_type_id' => EventType::factory(), - 'slug' => Str::slug($label . '-' . $this->faker->unique()->numberBetween(1, 9999)), + 'slug' => Str::slug($label.'-'.$this->faker->unique()->numberBetween(1, 9999)), 'name_translations' => [ 'de' => $label, 'en' => $label, diff --git a/database/factories/TaskFactory.php b/database/factories/TaskFactory.php index 3b3ca00..9e41ba4 100644 --- a/database/factories/TaskFactory.php +++ b/database/factories/TaskFactory.php @@ -19,7 +19,7 @@ class TaskFactory extends Factory return [ 'tenant_id' => Tenant::factory(), - 'slug' => Str::slug($title . '-' . $this->faker->unique()->numberBetween(1, 9999)), + 'slug' => Str::slug($title.'-'.$this->faker->unique()->numberBetween(1, 9999)), 'title' => [ 'de' => $title, 'en' => $title, diff --git a/database/migrations/2024_10_13_000001_update_task_collections_and_tasks_for_localization.php b/database/migrations/2024_10_13_000001_update_task_collections_and_tasks_for_localization.php index dacbc29..8121e5f 100644 --- a/database/migrations/2024_10_13_000001_update_task_collections_and_tasks_for_localization.php +++ b/database/migrations/2024_10_13_000001_update_task_collections_and_tasks_for_localization.php @@ -69,13 +69,13 @@ return new class extends Migration ] : null; - $slugBase = Str::slug($name ?: ('collection-' . $row->id)); + $slugBase = Str::slug($name ?: ('collection-'.$row->id)); if (empty($slugBase)) { - $slugBase = 'collection-' . $row->id; + $slugBase = 'collection-'.$row->id; } - $slug = $row->slug ?: ($slugBase . '-' . $row->id); + $slug = $row->slug ?: ($slugBase.'-'.$row->id); DB::table('task_collections') ->where('id', $row->id) @@ -127,11 +127,11 @@ return new class extends Migration return; } - DB::table('tasks') - ->select('id', 'slug', 'title') - ->orderBy('id') - ->chunk(100, function ($rows) { - foreach ($rows as $row) { + DB::table('tasks') + ->select('id', 'slug', 'title') + ->orderBy('id') + ->chunk(100, function ($rows) { + foreach ($rows as $row) { if (! empty($row->slug)) { continue; } @@ -146,21 +146,21 @@ return new class extends Migration $base = $json['de'] ?? $json['en'] - ?? ('task-' . $row->id); + ?? ('task-'.$row->id); $slug = Str::slug($base); if (empty($slug)) { - $slug = 'task-' . $row->id; + $slug = 'task-'.$row->id; } DB::table('tasks') ->where('id', $row->id) ->update([ - 'slug' => $slug . '-' . $row->id, + 'slug' => $slug.'-'.$row->id, ]); - } - }); + } + }); Schema::table('tasks', function (Blueprint $table) { $table->unique('slug'); @@ -232,7 +232,7 @@ return new class extends Migration DB::table('task_collections') ->where('id', $row->id) ->update([ - 'name' => $names['de'] ?? $names['en'] ?? 'Collection ' . $row->id, + 'name' => $names['de'] ?? $names['en'] ?? 'Collection '.$row->id, 'description' => $descriptions['de'] ?? $descriptions['en'] ?? null, ]); } diff --git a/database/migrations/2025_02_28_000100_create_tenancy_system.php b/database/migrations/2025_02_28_000100_create_tenancy_system.php index 11824b7..e8b0f9a 100644 --- a/database/migrations/2025_02_28_000100_create_tenancy_system.php +++ b/database/migrations/2025_02_28_000100_create_tenancy_system.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { // Create tenants table if not exists - if (!Schema::hasTable('tenants')) { + if (! Schema::hasTable('tenants')) { Schema::create('tenants', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -32,7 +32,7 @@ return new class extends Migration }); } else { // Add missing columns to existing tenants table - if (!Schema::hasColumn('tenants', 'email')) { + if (! Schema::hasColumn('tenants', 'email')) { Schema::table('tenants', function (Blueprint $table) { $table->string('email')->nullable()->after('contact_phone'); }); @@ -42,17 +42,17 @@ return new class extends Migration $table->dropColumn(['event_credits_balance', 'free_event_granted_at']); }); } - if (!Schema::hasColumn('tenants', 'stripe_account_id')) { + if (! Schema::hasColumn('tenants', 'stripe_account_id')) { Schema::table('tenants', function (Blueprint $table) { $table->string('stripe_account_id')->nullable()->after('features'); }); } - if (!Schema::hasColumn('tenants', 'custom_domain')) { + if (! Schema::hasColumn('tenants', 'custom_domain')) { Schema::table('tenants', function (Blueprint $table) { $table->string('custom_domain')->nullable()->after('domain'); }); } - if (!Schema::hasColumn('tenants', 'user_id')) { + if (! Schema::hasColumn('tenants', 'user_id')) { Schema::table('tenants', function (Blueprint $table) { $table->foreignId('user_id')->nullable()->constrained('users')->onDelete('cascade')->after('id'); }); @@ -68,7 +68,7 @@ return new class extends Migration }); } // Add subscription fields (from add_subscription_fields_to_tenants_table) - if (!Schema::hasColumn('tenants', 'subscription_status')) { + if (! Schema::hasColumn('tenants', 'subscription_status')) { Schema::table('tenants', function (Blueprint $table) { $table->string('subscription_status')->default('active')->after('event_credits_balance'); $table->timestamp('subscription_ends_at')->nullable()->after('subscription_status'); @@ -77,14 +77,14 @@ return new class extends Migration } // Add tenant_id to users if not exists - if (Schema::hasTable('users') && !Schema::hasColumn('users', 'tenant_id')) { + if (Schema::hasTable('users') && ! Schema::hasColumn('users', 'tenant_id')) { Schema::table('users', function (Blueprint $table) { $table->foreignId('tenant_id')->nullable()->after('id')->constrained('tenants')->nullOnDelete(); }); } // Add tenant_id to events if not exists - if (Schema::hasTable('events') && !Schema::hasColumn('events', 'tenant_id')) { + if (Schema::hasTable('events') && ! Schema::hasColumn('events', 'tenant_id')) { Schema::table('events', function (Blueprint $table) { $table->foreignId('tenant_id')->nullable()->after('id')->constrained('tenants')->nullOnDelete(); }); diff --git a/database/migrations/2025_09_01_000200_create_event_basics.php b/database/migrations/2025_09_01_000200_create_event_basics.php index 61102a9..096dbb6 100644 --- a/database/migrations/2025_09_01_000200_create_event_basics.php +++ b/database/migrations/2025_09_01_000200_create_event_basics.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { // Event Types - if (!Schema::hasTable('event_types')) { + if (! Schema::hasTable('event_types')) { Schema::create('event_types', function (Blueprint $table) { $table->id(); $table->json('name'); @@ -21,7 +21,7 @@ return new class extends Migration } // Emotions - if (!Schema::hasTable('emotions')) { + if (! Schema::hasTable('emotions')) { Schema::create('emotions', function (Blueprint $table) { $table->id(); $table->json('name'); @@ -35,7 +35,7 @@ return new class extends Migration } // Pivot table for emotions and event types - if (!Schema::hasTable('emotion_event_type')) { + if (! Schema::hasTable('emotion_event_type')) { Schema::create('emotion_event_type', function (Blueprint $table) { $table->unsignedBigInteger('emotion_id'); $table->unsignedBigInteger('event_type_id'); @@ -54,4 +54,4 @@ return new class extends Migration Schema::dropIfExists('event_types'); } } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_09_01_000500_create_legal_pages.php b/database/migrations/2025_09_01_000500_create_legal_pages.php index ebb1209..9914538 100644 --- a/database/migrations/2025_09_01_000500_create_legal_pages.php +++ b/database/migrations/2025_09_01_000500_create_legal_pages.php @@ -10,7 +10,7 @@ return new class extends Migration public function up(): void { // Legal Pages table - if (!Schema::hasTable('legal_pages')) { + if (! Schema::hasTable('legal_pages')) { Schema::create('legal_pages', function (Blueprint $table) { $table->id(); $table->string('slug', 32); @@ -86,7 +86,7 @@ return new class extends Migration private function impressumDe(): string { - return <<id(); $table->string('name')->nullable(); @@ -21,13 +21,13 @@ return new class extends Migration $table->timestamps(); }); } else { - if (!Schema::hasColumn('blog_categories', 'name')) { + if (! Schema::hasColumn('blog_categories', 'name')) { Schema::table('blog_categories', function (Blueprint $table) { $table->string('name')->nullable()->after('id'); $table->longText('description')->nullable()->after('name'); }); } - if (!Schema::hasColumn('blog_categories', 'translations')) { + if (! Schema::hasColumn('blog_categories', 'translations')) { Schema::table('blog_categories', function (Blueprint $table) { $table->json('translations')->nullable()->after('description'); }); @@ -35,7 +35,7 @@ return new class extends Migration } // Blog Authors - if (!Schema::hasTable('blog_authors')) { + if (! Schema::hasTable('blog_authors')) { Schema::create('blog_authors', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -49,7 +49,7 @@ return new class extends Migration } // Blog Posts - if (!Schema::hasTable('blog_posts')) { + if (! Schema::hasTable('blog_posts')) { Schema::create('blog_posts', function (Blueprint $table) { $table->id(); $table->foreignId('blog_author_id')->nullable()->constrained()->cascadeOnDelete(); @@ -65,7 +65,7 @@ return new class extends Migration $table->timestamps(); }); } else { - if (!Schema::hasColumn('blog_posts', 'translations')) { + if (! Schema::hasColumn('blog_posts', 'translations')) { Schema::table('blog_posts', function (Blueprint $table) { $table->json('translations')->nullable()->after('content'); }); @@ -73,7 +73,7 @@ return new class extends Migration } // Tags - if (!Schema::hasTable('tags')) { + if (! Schema::hasTable('tags')) { Schema::create('tags', function (Blueprint $table) { $table->id(); $table->json('name'); @@ -85,7 +85,7 @@ return new class extends Migration } // Taggables (polymorphic) - if (!Schema::hasTable('taggables')) { + if (! Schema::hasTable('taggables')) { Schema::create('taggables', function (Blueprint $table) { $table->foreignId('tag_id')->constrained()->cascadeOnDelete(); $table->morphs('taggable'); @@ -124,4 +124,4 @@ return new class extends Migration Schema::dropIfExists('blog_categories'); } } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_09_27_110000_add_personal_fields_to_users_table.php b/database/migrations/2025_09_27_110000_add_personal_fields_to_users_table.php index a4fb398..e5cd7b7 100644 --- a/database/migrations/2025_09_27_110000_add_personal_fields_to_users_table.php +++ b/database/migrations/2025_09_27_110000_add_personal_fields_to_users_table.php @@ -12,16 +12,16 @@ return new class extends Migration public function up(): void { Schema::table('users', function (Blueprint $table) { - if (!Schema::hasColumn('tenants', 'first_name')) { + if (! Schema::hasColumn('tenants', 'first_name')) { $table->string('first_name')->default('')->after('name'); } - if (!Schema::hasColumn('tenants', 'last_name')) { + if (! Schema::hasColumn('tenants', 'last_name')) { $table->string('last_name')->default('')->after('first_name'); } - if (!Schema::hasColumn('tenants', 'address')) { + if (! Schema::hasColumn('tenants', 'address')) { $table->string('address')->nullable()->after('last_name'); } - if (!Schema::hasColumn('tenants', 'phone')) { + if (! Schema::hasColumn('tenants', 'phone')) { $table->string('phone')->nullable()->after('address'); } }); @@ -36,4 +36,4 @@ return new class extends Migration $table->dropColumn(['first_name', 'last_name', 'address', 'phone']); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_09_30_000000_make_provider_id_nullable_in_package_purchases_table.php b/database/migrations/2025_09_30_000000_make_provider_id_nullable_in_package_purchases_table.php index 74ce086..5551f15 100644 --- a/database/migrations/2025_09_30_000000_make_provider_id_nullable_in_package_purchases_table.php +++ b/database/migrations/2025_09_30_000000_make_provider_id_nullable_in_package_purchases_table.php @@ -25,4 +25,4 @@ return new class extends Migration $table->string('provider_id')->nullable(false)->change(); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_09_30_000001_add_missing_fields_to_tenants_table.php b/database/migrations/2025_09_30_000001_add_missing_fields_to_tenants_table.php index 7d57c29..228cd94 100644 --- a/database/migrations/2025_09_30_000001_add_missing_fields_to_tenants_table.php +++ b/database/migrations/2025_09_30_000001_add_missing_fields_to_tenants_table.php @@ -12,13 +12,13 @@ return new class extends Migration public function up(): void { Schema::table('tenants', function (Blueprint $table) { - if (!Schema::hasColumn('tenants', 'is_suspended')) { + if (! Schema::hasColumn('tenants', 'is_suspended')) { $table->boolean('is_suspended')->default(false)->after('is_active'); } - if (!Schema::hasColumn('tenants', 'settings')) { + if (! Schema::hasColumn('tenants', 'settings')) { $table->json('settings')->nullable()->after('subscription_expires_at'); } - if (!Schema::hasColumn('tenants', 'settings_updated_at')) { + if (! Schema::hasColumn('tenants', 'settings_updated_at')) { $table->timestamp('settings_updated_at')->nullable()->after('settings'); } }); @@ -33,4 +33,4 @@ return new class extends Migration $table->dropColumn(['is_suspended', 'settings', 'settings_updated_at']); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_09_30_000002_add_missing_fields_to_packages_table.php b/database/migrations/2025_09_30_000002_add_missing_fields_to_packages_table.php index 8eb3859..ddfd57d 100644 --- a/database/migrations/2025_09_30_000002_add_missing_fields_to_packages_table.php +++ b/database/migrations/2025_09_30_000002_add_missing_fields_to_packages_table.php @@ -2,8 +2,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; return new class extends Migration @@ -14,10 +14,10 @@ return new class extends Migration public function up(): void { Schema::table('packages', function (Blueprint $table) { - if (!Schema::hasColumn('packages', 'slug')) { + if (! Schema::hasColumn('packages', 'slug')) { $table->string('slug')->default('')->after('name'); } - if (!Schema::hasColumn('packages', 'description')) { + if (! Schema::hasColumn('packages', 'description')) { $table->text('description')->nullable()->after('slug'); } }); @@ -26,7 +26,7 @@ return new class extends Migration if (Schema::hasTable('packages')) { $packages = DB::table('packages')->get(); foreach ($packages as $package) { - $slug = Str::slug($package->name . '-' . $package->id); + $slug = Str::slug($package->name.'-'.$package->id); DB::table('packages')->where('id', $package->id)->update(['slug' => $slug]); } } @@ -49,4 +49,4 @@ return new class extends Migration $table->dropColumn(['slug', 'description']); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_10_01_123600_remove_name_from_users_table.php b/database/migrations/2025_10_01_123600_remove_name_from_users_table.php index f75d73a..6c019c2 100644 --- a/database/migrations/2025_10_01_123600_remove_name_from_users_table.php +++ b/database/migrations/2025_10_01_123600_remove_name_from_users_table.php @@ -25,4 +25,4 @@ return new class extends Migration $table->string('name')->after('id'); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_10_03_000000_add_pending_purchase_to_users_table.php b/database/migrations/2025_10_03_000000_add_pending_purchase_to_users_table.php index 1ce1323..92ab755 100644 --- a/database/migrations/2025_10_03_000000_add_pending_purchase_to_users_table.php +++ b/database/migrations/2025_10_03_000000_add_pending_purchase_to_users_table.php @@ -25,4 +25,4 @@ return new class extends Migration $table->dropColumn('pending_purchase'); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_10_13_000003_add_slugs_to_tasks_and_collections.php b/database/migrations/2025_10_13_000003_add_slugs_to_tasks_and_collections.php index b298263..51ef287 100644 --- a/database/migrations/2025_10_13_000003_add_slugs_to_tasks_and_collections.php +++ b/database/migrations/2025_10_13_000003_add_slugs_to_tasks_and_collections.php @@ -40,7 +40,7 @@ return new class extends Migration } $translations = $this->decodeTranslations($row->name_translations); - $base = $translations['en'] ?? $translations['de'] ?? reset($translations) ?? ('collection-' . $row->id); + $base = $translations['en'] ?? $translations['de'] ?? reset($translations) ?? ('collection-'.$row->id); $slug = $this->buildUniqueSlug($base, 'collection-', function ($candidate) { return DB::table('task_collections')->where('slug', $candidate)->exists(); }); @@ -76,7 +76,7 @@ return new class extends Migration } $translations = $this->decodeTranslations($row->title); - $base = $translations['en'] ?? $translations['de'] ?? reset($translations) ?? ('task-' . $row->id); + $base = $translations['en'] ?? $translations['de'] ?? reset($translations) ?? ('task-'.$row->id); $slug = $this->buildUniqueSlug($base, 'task-', function ($candidate) { return DB::table('tasks')->where('slug', $candidate)->exists(); }); @@ -139,10 +139,10 @@ return new class extends Migration protected function buildUniqueSlug(string $base, string $prefix, callable $exists): string { - $slugBase = Str::slug($base) ?: ($prefix . Str::random(4)); + $slugBase = Str::slug($base) ?: ($prefix.Str::random(4)); do { - $candidate = $slugBase . '-' . Str::random(4); + $candidate = $slugBase.'-'.Str::random(4); } while ($exists($candidate)); return $candidate; diff --git a/database/migrations/2025_10_17_000001_add_description_table_to_packages.php b/database/migrations/2025_10_17_000001_add_description_table_to_packages.php index 7f6bc9c..ea17df2 100644 --- a/database/migrations/2025_10_17_000001_add_description_table_to_packages.php +++ b/database/migrations/2025_10_17_000001_add_description_table_to_packages.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { Schema::table('packages', function (Blueprint $table) { - if (!Schema::hasColumn('packages', 'description_table')) { + if (! Schema::hasColumn('packages', 'description_table')) { $table->json('description_table')->nullable()->after('description'); } }); diff --git a/database/migrations/2025_10_17_000002_add_translation_columns_to_packages.php b/database/migrations/2025_10_17_000002_add_translation_columns_to_packages.php index 27f5892..a5267a7 100644 --- a/database/migrations/2025_10_17_000002_add_translation_columns_to_packages.php +++ b/database/migrations/2025_10_17_000002_add_translation_columns_to_packages.php @@ -2,8 +2,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Schema; return new class extends Migration { diff --git a/database/migrations/2025_10_20_090000_create_media_storage_targets_table.php b/database/migrations/2025_10_20_090000_create_media_storage_targets_table.php index 24bcd15..79167a5 100644 --- a/database/migrations/2025_10_20_090000_create_media_storage_targets_table.php +++ b/database/migrations/2025_10_20_090000_create_media_storage_targets_table.php @@ -33,4 +33,3 @@ return new class extends Migration Schema::dropIfExists('media_storage_targets'); } }; - diff --git a/database/migrations/2025_10_20_090100_create_event_storage_assignments_table.php b/database/migrations/2025_10_20_090100_create_event_storage_assignments_table.php index c3840e6..a67c964 100644 --- a/database/migrations/2025_10_20_090100_create_event_storage_assignments_table.php +++ b/database/migrations/2025_10_20_090100_create_event_storage_assignments_table.php @@ -34,4 +34,3 @@ return new class extends Migration Schema::dropIfExists('event_storage_assignments'); } }; - diff --git a/database/migrations/2025_10_20_090200_create_event_media_assets_table.php b/database/migrations/2025_10_20_090200_create_event_media_assets_table.php index d37cd7f..4ac3a61 100644 --- a/database/migrations/2025_10_20_090200_create_event_media_assets_table.php +++ b/database/migrations/2025_10_20_090200_create_event_media_assets_table.php @@ -43,4 +43,3 @@ return new class extends Migration Schema::dropIfExists('event_media_assets'); } }; - diff --git a/database/migrations/2025_10_20_090300_add_media_asset_id_to_photos_table.php b/database/migrations/2025_10_20_090300_add_media_asset_id_to_photos_table.php index 431fb1f..19e4256 100644 --- a/database/migrations/2025_10_20_090300_add_media_asset_id_to_photos_table.php +++ b/database/migrations/2025_10_20_090300_add_media_asset_id_to_photos_table.php @@ -24,4 +24,3 @@ return new class extends Migration }); } }; - diff --git a/database/migrations/2025_10_22_000100_add_secure_columns_to_event_join_tokens.php b/database/migrations/2025_10_22_000100_add_secure_columns_to_event_join_tokens.php index 6fc2a25..e8701ee 100644 --- a/database/migrations/2025_10_22_000100_add_secure_columns_to_event_join_tokens.php +++ b/database/migrations/2025_10_22_000100_add_secure_columns_to_event_join_tokens.php @@ -13,17 +13,17 @@ return new class extends Migration $addedTokenHashColumn = false; Schema::table('event_join_tokens', function (Blueprint $table) use (&$addedTokenHashColumn) { - if (!Schema::hasColumn('event_join_tokens', 'token_hash')) { + if (! Schema::hasColumn('event_join_tokens', 'token_hash')) { $table->string('token_hash', 128)->nullable()->after('token'); $table->index('token_hash', 'event_join_tokens_token_hash_index'); $addedTokenHashColumn = true; } - if (!Schema::hasColumn('event_join_tokens', 'token_encrypted')) { + if (! Schema::hasColumn('event_join_tokens', 'token_encrypted')) { $table->text('token_encrypted')->nullable()->after('token_hash'); } - if (!Schema::hasColumn('event_join_tokens', 'token_preview')) { + if (! Schema::hasColumn('event_join_tokens', 'token_preview')) { $table->string('token_preview', 32)->nullable()->after('token_encrypted'); } }); @@ -33,20 +33,20 @@ return new class extends Migration ->whereNotNull('token') ->orderBy('id') ->chunkById(200, function ($tokens) { - foreach ($tokens as $token) { - $hash = hash('sha256', $token->token); - $preview = $this->previewToken($token->token); + foreach ($tokens as $token) { + $hash = hash('sha256', $token->token); + $preview = $this->previewToken($token->token); - DB::table('event_join_tokens') - ->where('id', $token->id) - ->update([ - 'token_hash' => $hash, - 'token_encrypted' => Crypt::encryptString($token->token), - 'token_preview' => $preview, - 'token' => $hash, - ]); - } - }); + DB::table('event_join_tokens') + ->where('id', $token->id) + ->update([ + 'token_hash' => $hash, + 'token_encrypted' => Crypt::encryptString($token->token), + 'token_preview' => $preview, + 'token' => $hash, + ]); + } + }); if ($addedTokenHashColumn) { Schema::table('event_join_tokens', function (Blueprint $table) { @@ -76,7 +76,7 @@ return new class extends Migration ->filter(fn ($column) => Schema::hasColumn('event_join_tokens', $column)) ->all(); - if (!empty($columns)) { + if (! empty($columns)) { $table->dropColumn($columns); } }); diff --git a/database/migrations/2025_10_22_000200_add_security_columns_to_photos.php b/database/migrations/2025_10_22_000200_add_security_columns_to_photos.php index 4206456..9d430b9 100644 --- a/database/migrations/2025_10_22_000200_add_security_columns_to_photos.php +++ b/database/migrations/2025_10_22_000200_add_security_columns_to_photos.php @@ -23,4 +23,3 @@ return new class extends Migration }); } }; - diff --git a/database/migrations/2025_10_23_000500_create_event_join_token_events_table.php b/database/migrations/2025_10_23_000500_create_event_join_token_events_table.php index dc1a90e..bc8b9bf 100644 --- a/database/migrations/2025_10_23_000500_create_event_join_token_events_table.php +++ b/database/migrations/2025_10_23_000500_create_event_join_token_events_table.php @@ -35,4 +35,3 @@ return new class extends Migration Schema::dropIfExists('event_join_token_events'); } }; - diff --git a/database/migrations/2025_11_18_161628_rename_coolify_action_logs_table.php b/database/migrations/2025_11_18_161628_rename_coolify_action_logs_table.php index 755e30a..7b324d1 100644 --- a/database/migrations/2025_11_18_161628_rename_coolify_action_logs_table.php +++ b/database/migrations/2025_11_18_161628_rename_coolify_action_logs_table.php @@ -1,7 +1,6 @@ ['de'=>'Liebe','en'=>'Love'], 'icon'=>'💖', 'color'=>'#ff6b9d', 'description'=>['de'=>'Romantische Momente','en'=>'Romantic moments'], 'sort_order'=>1], - ['name'=>['de'=>'Freude','en'=>'Joy'], 'icon'=>'😊', 'color'=>'#ffd93d', 'description'=>['de'=>'Fröhliche Augenblicke','en'=>'Happy moments'], 'sort_order'=>2], - ['name'=>['de'=>'Rührung','en'=>'Touched'], 'icon'=>'🥹', 'color'=>'#6bcf7f', 'description'=>['de'=>'Berührende Szenen','en'=>'Touching scenes'], 'sort_order'=>3], - ['name'=>['de'=>'Nostalgie','en'=>'Nostalgia'], 'icon'=>'🕰️', 'color'=>'#a78bfa', 'description'=>['de'=>'Erinnerungen','en'=>'Memories'], 'sort_order'=>4], - ['name'=>['de'=>'Überraschung','en'=>'Surprise'], 'icon'=>'😲', 'color'=>'#fb7185', 'description'=>['de'=>'Unerwartete Momente','en'=>'Unexpected moments'], 'sort_order'=>5], - ['name'=>['de'=>'Stolz','en'=>'Pride'], 'icon'=>'🏆', 'color'=>'#34d399', 'description'=>['de'=>'Triumphale Augenblicke','en'=>'Triumphal moments'], 'sort_order'=>6], - ['name'=>['de'=>'Teamgeist','en'=>'Team Spirit'], 'icon'=>'🤝', 'color'=>'#38bdf8', 'description'=>['de'=>'Zusammenhalt','en'=>'Team bonding'], 'sort_order'=>7], - ['name'=>['de'=>'Besinnlichkeit','en'=>'Contemplation'], 'icon'=>'🕯️', 'color'=>'#22c55e', 'description'=>['de'=>'Feierliche Stimmung','en'=>'Festive calm'], 'sort_order'=>8], - ['name'=>['de'=>'Romantik','en'=>'Romance'], 'icon'=>'🌹', 'color'=>'#e11d48', 'description'=>['de'=>'Romantische Stimmung','en'=>'Romantic mood'], 'sort_order'=>9], - ['name'=>['de'=>'Ekstase','en'=>'Ecstasy'], 'icon'=>'🎉', 'color'=>'#f59e0b', 'description'=>['de'=>'Pure Lebensfreude','en'=>'Pure zest for life'], 'sort_order'=>10], + ['name' => ['de' => 'Liebe', 'en' => 'Love'], 'icon' => '💖', 'color' => '#ff6b9d', 'description' => ['de' => 'Romantische Momente', 'en' => 'Romantic moments'], 'sort_order' => 1], + ['name' => ['de' => 'Freude', 'en' => 'Joy'], 'icon' => '😊', 'color' => '#ffd93d', 'description' => ['de' => 'Fröhliche Augenblicke', 'en' => 'Happy moments'], 'sort_order' => 2], + ['name' => ['de' => 'Rührung', 'en' => 'Touched'], 'icon' => '🥹', 'color' => '#6bcf7f', 'description' => ['de' => 'Berührende Szenen', 'en' => 'Touching scenes'], 'sort_order' => 3], + ['name' => ['de' => 'Nostalgie', 'en' => 'Nostalgia'], 'icon' => '🕰️', 'color' => '#a78bfa', 'description' => ['de' => 'Erinnerungen', 'en' => 'Memories'], 'sort_order' => 4], + ['name' => ['de' => 'Überraschung', 'en' => 'Surprise'], 'icon' => '😲', 'color' => '#fb7185', 'description' => ['de' => 'Unerwartete Momente', 'en' => 'Unexpected moments'], 'sort_order' => 5], + ['name' => ['de' => 'Stolz', 'en' => 'Pride'], 'icon' => '🏆', 'color' => '#34d399', 'description' => ['de' => 'Triumphale Augenblicke', 'en' => 'Triumphal moments'], 'sort_order' => 6], + ['name' => ['de' => 'Teamgeist', 'en' => 'Team Spirit'], 'icon' => '🤝', 'color' => '#38bdf8', 'description' => ['de' => 'Zusammenhalt', 'en' => 'Team bonding'], 'sort_order' => 7], + ['name' => ['de' => 'Besinnlichkeit', 'en' => 'Contemplation'], 'icon' => '🕯️', 'color' => '#22c55e', 'description' => ['de' => 'Feierliche Stimmung', 'en' => 'Festive calm'], 'sort_order' => 8], + ['name' => ['de' => 'Romantik', 'en' => 'Romance'], 'icon' => '🌹', 'color' => '#e11d48', 'description' => ['de' => 'Romantische Stimmung', 'en' => 'Romantic mood'], 'sort_order' => 9], + ['name' => ['de' => 'Ekstase', 'en' => 'Ecstasy'], 'icon' => '🎉', 'color' => '#f59e0b', 'description' => ['de' => 'Pure Lebensfreude', 'en' => 'Pure zest for life'], 'sort_order' => 10], ]; $typeIds = EventType::pluck('id')->toArray(); @@ -38,4 +38,3 @@ class EmotionsSeeder extends Seeder } } } - diff --git a/database/seeders/EventTypesSeeder.php b/database/seeders/EventTypesSeeder.php index 02a8093..2410966 100644 --- a/database/seeders/EventTypesSeeder.php +++ b/database/seeders/EventTypesSeeder.php @@ -2,24 +2,23 @@ namespace Database\Seeders; -use Illuminate\Database\Seeder; use App\Models\EventType; +use Illuminate\Database\Seeder; class EventTypesSeeder extends Seeder { public function run(): void { $types = [ - ['name' => ['de'=>'Hochzeit','en'=>'Wedding'], 'slug'=>'wedding', 'icon'=>'💍'], - ['name' => ['de'=>'Geburtstag','en'=>'Birthday'], 'slug'=>'birthday', 'icon'=>'🎂'], - ['name' => ['de'=>'Weihnachten','en'=>'Christmas'], 'slug'=>'christmas', 'icon'=>'🎄'], - ['name' => ['de'=>'Konfirmation / Jugendweihe','en'=>'Confirmation'], 'slug'=>'confirmation', 'icon'=>'🕊️'], - ['name' => ['de'=>'Schulabschluss','en'=>'Graduation'], 'slug'=>'graduation', 'icon'=>'🎓'], - ['name' => ['de'=>'Firmenfeier','en'=>'Corporate'], 'slug'=>'corporate', 'icon'=>'🏢'], + ['name' => ['de' => 'Hochzeit', 'en' => 'Wedding'], 'slug' => 'wedding', 'icon' => '💍'], + ['name' => ['de' => 'Geburtstag', 'en' => 'Birthday'], 'slug' => 'birthday', 'icon' => '🎂'], + ['name' => ['de' => 'Weihnachten', 'en' => 'Christmas'], 'slug' => 'christmas', 'icon' => '🎄'], + ['name' => ['de' => 'Konfirmation / Jugendweihe', 'en' => 'Confirmation'], 'slug' => 'confirmation', 'icon' => '🕊️'], + ['name' => ['de' => 'Schulabschluss', 'en' => 'Graduation'], 'slug' => 'graduation', 'icon' => '🎓'], + ['name' => ['de' => 'Firmenfeier', 'en' => 'Corporate'], 'slug' => 'corporate', 'icon' => '🏢'], ]; foreach ($types as $t) { - EventType::updateOrCreate(['slug'=>$t['slug']], $t); + EventType::updateOrCreate(['slug' => $t['slug']], $t); } } } - diff --git a/database/seeders/LegalPagesSeeder.php b/database/seeders/LegalPagesSeeder.php index df86e98..37318e4 100644 --- a/database/seeders/LegalPagesSeeder.php +++ b/database/seeders/LegalPagesSeeder.php @@ -90,4 +90,3 @@ class LegalPagesSeeder extends Seeder ); } } - diff --git a/resources/lang/de/admin.php b/resources/lang/de/admin.php index f3f50a8..1cfddb2 100644 --- a/resources/lang/de/admin.php +++ b/resources/lang/de/admin.php @@ -25,6 +25,7 @@ return [ ], 'common' => [ + 'error' => 'Fehler', 'key' => 'Schlüssel', 'value' => 'Wert', 'locale' => 'Sprache', @@ -466,6 +467,9 @@ return [ 'icon' => 'Icon', 'created_at' => 'Erstellt', ], + 'messages' => [ + 'delete_constraint_error' => 'Dieser Eventtyp wird derzeit verwendet und kann nicht gelöscht werden.', + ], ], 'tasks' => [ diff --git a/resources/lang/de/profile.php b/resources/lang/de/profile.php index 3ac6eb9..fcdc204 100644 --- a/resources/lang/de/profile.php +++ b/resources/lang/de/profile.php @@ -14,4 +14,4 @@ return [ 'save' => 'Speichern', 'delete_account' => 'Account löschen', 'delete' => 'Löschen', -]; \ No newline at end of file +]; diff --git a/resources/lang/de/validation.php b/resources/lang/de/validation.php index 22f8047..11fbde6 100644 --- a/resources/lang/de/validation.php +++ b/resources/lang/de/validation.php @@ -115,4 +115,4 @@ return [ 'password' => 'Passwort', 'privacy_consent' => 'Datenschutzbestätigung', ], -]; \ No newline at end of file +]; diff --git a/resources/lang/en/admin.php b/resources/lang/en/admin.php index 1582e7d..384e803 100644 --- a/resources/lang/en/admin.php +++ b/resources/lang/en/admin.php @@ -25,6 +25,7 @@ return [ ], 'common' => [ + 'error' => 'Error', 'key' => 'Key', 'value' => 'Value', 'locale' => 'Locale', @@ -459,6 +460,9 @@ return [ 'settings' => 'Settings', 'emotions' => 'Emotions', ], + 'messages' => [ + 'delete_constraint_error' => 'This event type is currently in use and cannot be deleted.', + ], ], 'tasks' => [ diff --git a/tests/Feature/Api/GiftVoucherResendTest.php b/tests/Feature/Api/GiftVoucherResendTest.php index 34e9ca2..6169aef 100644 --- a/tests/Feature/Api/GiftVoucherResendTest.php +++ b/tests/Feature/Api/GiftVoucherResendTest.php @@ -2,11 +2,11 @@ namespace Tests\Feature\Api; +use App\Mail\GiftVoucherIssued; use App\Models\GiftVoucher; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Mail; use Tests\TestCase; -use App\Mail\GiftVoucherIssued; class GiftVoucherResendTest extends TestCase { diff --git a/tests/Feature/Console/CheckEventPackagesCommandTest.php b/tests/Feature/Console/CheckEventPackagesCommandTest.php index 7cf99f5..b27f962 100644 --- a/tests/Feature/Console/CheckEventPackagesCommandTest.php +++ b/tests/Feature/Console/CheckEventPackagesCommandTest.php @@ -142,5 +142,4 @@ class CheckEventPackagesCommandTest extends TestCase Carbon::setTestNow(); } } - } diff --git a/tests/Feature/Jobs/ProcessPhotoSecurityScanTest.php b/tests/Feature/Jobs/ProcessPhotoSecurityScanTest.php index 812baf8..7813e15 100644 --- a/tests/Feature/Jobs/ProcessPhotoSecurityScanTest.php +++ b/tests/Feature/Jobs/ProcessPhotoSecurityScanTest.php @@ -24,7 +24,8 @@ class ProcessPhotoSecurityScanTest extends TestCase { [$photo, $asset] = $this->seedPhotoWithAsset(); - $scanner = new class extends PhotoSecurityScanner { + $scanner = new class extends PhotoSecurityScanner + { public function scan(string $disk, ?string $relativePath): array { return ['status' => 'clean', 'message' => 'ok']; @@ -49,7 +50,8 @@ class ProcessPhotoSecurityScanTest extends TestCase { [$photo] = $this->seedPhotoWithAsset(); - $scanner = new class extends PhotoSecurityScanner { + $scanner = new class extends PhotoSecurityScanner + { public function scan(string $disk, ?string $relativePath): array { return ['status' => 'skipped', 'message' => 'disabled']; @@ -73,7 +75,8 @@ class ProcessPhotoSecurityScanTest extends TestCase { [$photo, $asset] = $this->seedPhotoWithAsset(); - $scanner = new class extends PhotoSecurityScanner { + $scanner = new class extends PhotoSecurityScanner + { public function scan(string $disk, ?string $relativePath): array { return ['status' => 'infected', 'message' => 'bad']; diff --git a/tests/Feature/Marketing/MarketingLocaleRoutingTest.php b/tests/Feature/Marketing/MarketingLocaleRoutingTest.php index 199fb45..f5a1ccb 100644 --- a/tests/Feature/Marketing/MarketingLocaleRoutingTest.php +++ b/tests/Feature/Marketing/MarketingLocaleRoutingTest.php @@ -2,13 +2,14 @@ namespace Tests\Feature\Marketing; +use Illuminate\Foundation\Testing\RefreshDatabase; use Inertia\Testing\AssertableInertia as Assert; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class MarketingLocaleRoutingTest extends TestCase { use RefreshDatabase; + public function test_home_route_accepts_german_locale_prefix(): void { $response = $this->get('/de'); diff --git a/tests/Feature/PackageSeederTest.php b/tests/Feature/PackageSeederTest.php index 0e2ae43..65e92ba 100644 --- a/tests/Feature/PackageSeederTest.php +++ b/tests/Feature/PackageSeederTest.php @@ -11,7 +11,7 @@ class PackageSeederTest extends TestCase { use RefreshDatabase; - public function testStarterPackageHasSingleEventQuota(): void + public function test_starter_package_has_single_event_quota(): void { $this->seed(PackageSeeder::class); diff --git a/tests/Feature/Tenant/MockTenantMiddleware.php b/tests/Feature/Tenant/MockTenantMiddleware.php index 63f7dd1..99786d3 100644 --- a/tests/Feature/Tenant/MockTenantMiddleware.php +++ b/tests/Feature/Tenant/MockTenantMiddleware.php @@ -17,7 +17,7 @@ class MockTenantMiddleware $request->attributes->set('tenant_id', $tenant->id); $request->merge(['tenant_id' => $tenant->id]); } - + return $next($request); } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 100fdb3..3b0c29d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -64,15 +64,14 @@ KEY; mkdir($storagePath, 0755, true); } - $publicKeyPath = $storagePath . DIRECTORY_SEPARATOR . 'public.key'; + $publicKeyPath = $storagePath.DIRECTORY_SEPARATOR.'public.key'; if (! file_exists($publicKeyPath)) { file_put_contents($publicKeyPath, self::JWT_PUBLIC_KEY); } - $privateKeyPath = $storagePath . DIRECTORY_SEPARATOR . 'private.key'; + $privateKeyPath = $storagePath.DIRECTORY_SEPARATOR.'private.key'; if (! file_exists($privateKeyPath)) { file_put_contents($privateKeyPath, self::JWT_PRIVATE_KEY); } } } - diff --git a/tests/Unit/AdminDashboardWidgetsTest.php b/tests/Unit/AdminDashboardWidgetsTest.php index a91f530..b3911b4 100644 --- a/tests/Unit/AdminDashboardWidgetsTest.php +++ b/tests/Unit/AdminDashboardWidgetsTest.php @@ -50,7 +50,7 @@ class AdminDashboardWidgetsTest extends TestCase 'created_at' => now()->subMonth(), ]); - $widget = new RevenueTrendWidget(); + $widget = new RevenueTrendWidget; $data = $this->invokeProtectedMethod($widget, 'getData'); $this->assertArrayHasKey('datasets', $data); @@ -68,8 +68,6 @@ class AdminDashboardWidgetsTest extends TestCase /** * @template T * - * @param object $object - * @param string $method * @return mixed */ private function invokeProtectedMethod(object $object, string $method)