59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\KontoTextblocks;
|
|
|
|
use App\Filament\Clusters\Verwaltung\VerwaltungCluster;
|
|
use App\Filament\Resources\KontoTextblocks\Pages\ListKontoTextblocks;
|
|
use App\Filament\Resources\KontoTextblocks\Schemas\KontoTextblockForm;
|
|
use App\Filament\Resources\KontoTextblocks\Tables\KontoTextblocksTable;
|
|
use App\Models\KontoTextblock;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class KontoTextblockResource extends Resource
|
|
{
|
|
protected static ?string $model = KontoTextblock::class;
|
|
|
|
protected static ?int $navigationSort = 5;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'phosphor-article';
|
|
|
|
protected static ?string $cluster = VerwaltungCluster::class;
|
|
|
|
protected static ?string $navigationLabel = 'Textblock';
|
|
|
|
protected static ?string $modelLabel = 'Textblock';
|
|
|
|
protected static ?string $pluralModelLabel = 'Textblöcke';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return KontoTextblockForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return KontoTextblocksTable::configure($table);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListKontoTextblocks::route('/'),
|
|
];
|
|
}
|
|
|
|
public static function getEloquentQuery(): Builder
|
|
{
|
|
return parent::getEloquentQuery()->where('konto_id', auth()->user()->konto_id);
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return parent::getEloquentQuery()->where('konto_id', auth()->user()->konto_id)->count();
|
|
}
|
|
}
|