wip
This commit is contained in:
1 parent
883e947399
commit
b33513bbce
2 files changed
+37
-9
No files matched your search
@@ -62,6 +62,11 @@ class ProjekteForm
|
||||
'Als Platzhalter "###INTERNER_NAME###"',
|
||||
])
|
||||
->required(),
|
||||
Select::make('status')
|
||||
->selectablePlaceholder(false)
|
||||
->options(ProjektStatus::class)
|
||||
->required(),
|
||||
|
||||
])->columns(2),
|
||||
Tab::make('Ort & Datum')
|
||||
->icon('phosphor-calendar-check')
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
namespace App\Filament\Resources\Projektes\Tables;
|
||||
|
||||
use App\Enums\ProjektStatus;
|
||||
use App\Models\Auftraggeber;
|
||||
use App\Models\Gutachter;
|
||||
use App\Models\Projekte;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
@@ -29,18 +32,38 @@ class ProjektesTable
|
||||
TextColumn::make('gutachter.company'),
|
||||
TextColumn::make('auftraggeber.company'),
|
||||
TextColumn::make('ort'),
|
||||
TextColumn::make('erstellung'),
|
||||
SelectColumn::make('status')->options(ProjektStatus::class),
|
||||
|
||||
TextColumn::make('erstellung')->sortable(),
|
||||
])
|
||||
->striped()
|
||||
->defaultSort('erstellung', direction: 'desc')
|
||||
->persistSortInSession()
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->options(ProjektStatus::class),
|
||||
SelectFilter::make('gutachter')
|
||||
->relationship('gutachter', 'company'),
|
||||
SelectFilter::make('auftraggeber')
|
||||
->relationship('auftraggeber', 'company'),
|
||||
])
|
||||
SelectFilter::make('gutachter_id')
|
||||
->label('Gutachter')
|
||||
->searchable()
|
||||
->preload()
|
||||
->options(function () {
|
||||
$res = Projekte::where('konto_id', auth()->user()->konto_id)
|
||||
->groupBy('gutachter_id')
|
||||
->pluck('gutachter_id')->toArray();
|
||||
|
||||
return Gutachter::query()->whereIn('id', $res)->orderBy('company')->pluck('company', 'id');
|
||||
}),
|
||||
SelectFilter::make('auftraggeber_id')
|
||||
->label('Auftraggeber')
|
||||
->searchable()
|
||||
->preload()
|
||||
->options(function () {
|
||||
$res = Projekte::where('konto_id', auth()->user()->konto_id)
|
||||
->groupBy('auftraggeber_id')
|
||||
->pluck('auftraggeber_id')->toArray();
|
||||
|
||||
return Auftraggeber::query()->whereIn('id', $res)->orderBy('company')->pluck('company', 'id');
|
||||
}),
|
||||
], FiltersLayout::AboveContent)
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton(),
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user