fixed migrations, changed settings to global settings, changed image list to have a "delete all" button instead of "create", fixed printing, added imagick for printing.

This commit is contained in:
2025-08-26 10:39:18 +02:00
parent 44dd0f2867
commit 9b1f6a479f
69 changed files with 17232 additions and 1263 deletions

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Filament\Resources\ImageResource\Pages;
use App\Filament\Resources\ImageResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateImage extends CreateRecord
{
protected static string $resource = ImageResource::class;
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
}

View File

@@ -7,6 +7,8 @@ use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use Illuminate\Contracts\Pagination\Paginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Storage;
use Filament\Notifications\Notification;
class ListImages extends ListRecords
{
@@ -15,7 +17,25 @@ class ListImages extends ListRecords
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Actions\Action::make('delete_all')
->label('Delete All Images')
->icon('heroicon-o-trash')
->color('danger')
->requiresConfirmation()
->action(function () {
// Delete all images from storage
Storage::disk('public')->deleteDirectory('images');
Storage::disk('public')->makeDirectory('images');
// Show success notification
Notification::make()
->title('All images deleted successfully')
->success()
->send();
// Refresh the page
$this->redirect(static::getUrl());
}),
];
}