Raum Methode wip
This commit is contained in:
1 parent
9a7e6fa248
commit
064fceaca0
4 files changed
+33
-28
No files matched your search
+9
-4
@@ -4,9 +4,11 @@ namespace App\Filament\Resources\Projektes\RelationManagers;
|
||||
|
||||
use App\Actions\CreateProjektMethoden;
|
||||
use App\Models\Methode;
|
||||
use App\Models\ProjektMethode;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\BulkAction;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
@@ -34,7 +36,9 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('raumart')
|
||||
->columns([
|
||||
SelectColumn::make('methode_id')
|
||||
->options(Methode::query()->pluck('name', 'id')),
|
||||
->selectablePlaceholder(true)
|
||||
->optionsRelationship('methode', 'name')
|
||||
->preloadOptions(),
|
||||
TextColumn::make('raumart')
|
||||
->searchable(),
|
||||
TextInputColumn::make('faktor')
|
||||
@@ -82,9 +86,10 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->color('primary')
|
||||
->label('Methode zuweisen')
|
||||
->schema([
|
||||
TextInput::make('faktor')
|
||||
Select::make('methode_id')
|
||||
->label('Methode')
|
||||
->prefixIcon('phosphor-calculator')
|
||||
->numeric()
|
||||
->options(Methode::pluck('name', 'id'))
|
||||
->required(),
|
||||
])
|
||||
->icon('phosphor-calculator')
|
||||
@@ -92,7 +97,7 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
foreach ($records as $record) {
|
||||
ProjektMethode::where('id', '=', $record->id)
|
||||
->update(
|
||||
['faktor' => $data['faktor']]
|
||||
['methode_id' => $data['methode_id']]
|
||||
);
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user