KontoTextblocksTable
This commit is contained in:
1 parent
ae828ab8f5
commit
eaed59cceb
19 files changed
+532
-97
No files matched your search
@@ -0,0 +1,58 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user