Files
LarsandCursor cd79fb99d7
Deploy Test / test (push) Successful in 13s
Deploy Test / deploy (push) Successful in 23s
Zeige im Katalog, wie Inhalte, Pakete und Rechte zusammenhängen.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 10:03:19 +01:00

37 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Resources\Offers\Pages;
use App\Domain\Catalog\OfferService;
use App\Filament\Resources\Offers\OfferResource;
use App\Filament\Support\ReportsDomainRules;
use Filament\Actions\Action;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Pages\ListRecords;
use Illuminate\Contracts\Support\Htmlable;
class ListOffers extends ListRecords
{
use ReportsDomainRules;
protected static string $resource = OfferResource::class;
public function getSubheading(): string|Htmlable|null
{
return 'Ein Angebot verbindet Artikel oder eine Paketfassung mit einem Rechteprofil. Die aufgelösten Berechtigungen stehen auf der Angebotsseite.';
}
protected function getHeaderActions(): array
{
return [
Action::make('create')->label('Angebot anlegen')->schema([
TextInput::make('name')->label('Name')->required(),
])->action(function (array $data): void {
$this->report(function () use ($data): void {
app(OfferService::class)->create($data['name']);
}, 'Das Angebot ist angelegt.');
}),
];
}
}