70 lines
2.0 KiB
PHP
70 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Projektes;
|
|
|
|
use App\Filament\Clusters\Projekte\ProjekteCluster;
|
|
use App\Filament\Resources\Projektes\Pages\CreateProjekte;
|
|
use App\Filament\Resources\Projektes\Pages\EditProjekte;
|
|
use App\Filament\Resources\Projektes\Pages\ListProjektes;
|
|
use App\Filament\Resources\Projektes\Schemas\ProjekteForm;
|
|
use App\Filament\Resources\Projektes\Tables\ProjektesTable;
|
|
use App\Models\Projekte;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class ProjekteResource extends Resource
|
|
{
|
|
protected static ?string $model = Projekte::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
|
|
|
// protected static ?string $cluster = ProjekteCluster::class;
|
|
|
|
protected static ?string $recordTitleAttribute = 'interner_name';
|
|
|
|
protected static ?string $navigationLabel = 'Projekte';
|
|
|
|
protected static ?string $modelLabel = 'Projekte';
|
|
|
|
protected static ?string $pluralModelLabel = 'Projekte';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return ProjekteForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return ProjektesTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListProjektes::route('/'),
|
|
// 'create' => CreateProjekte::route('/create'),
|
|
'edit' => EditProjekte::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|