Files
laraundfelix/app/Filament/Resources/LicenseArticles/Pages/ListLicenseArticles.php
T
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

41 lines
1.4 KiB
PHP

<?php
namespace App\Filament\Resources\LicenseArticles\Pages;
use App\Domain\Catalog\ArticleService;
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
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 ListLicenseArticles extends ListRecords
{
use ReportsDomainRules;
protected static string $resource = LicenseArticleResource::class;
public function getSubheading(): string|Htmlable|null
{
return 'Kleinste lizenzierbare Einheit. Der Stand hält fest, welche Inhalte dazugehören. Pakete und Angebote verweisen auf den Artikel, sie kopieren ihn nicht.';
}
protected function getHeaderActions(): array
{
return [
Action::make('create')
->label('Artikel anlegen')
->schema([
TextInput::make('code')->label('Kennung')->required(),
TextInput::make('product_line')->label('Produktlinie'),
])
->action(function (array $data): void {
$this->report(function () use ($data): void {
app(ArticleService::class)->create($data['code'], $data['product_line'] ?? null);
}, 'Der Lizenzartikel ist angelegt.');
}),
];
}
}