zuabschl wip

This commit is contained in:
salam committed 2025-10-08 12:05:35 +02:00
1 parent 79c0b14bb5
commit 1728384c4e
12 files changed
+12411 -104

No files matched your search

@@ -3,6 +3,7 @@
namespace App\Filament\Resources\Projektes\Widgets;
use App\Models\Merkmale;
use App\Models\OrientierungZuAbschlaege;
use Filament\Actions\Action;
use Filament\Actions\DeleteAction;
use Filament\Actions\EditAction;
@@ -14,29 +15,22 @@ use Illuminate\Database\Eloquent\Builder;
class WidgetMerkmale extends TableWidget
{
// protected static ?string $title = 'Merkmale';
protected static ?string $navigationLabel = 'Merkmal';
// protected static ?string $navigationLabel = 'Merkmale';
protected static ?string $pluralModelLabel = 'Merkmale';
// protected static ?string $pluralModelLabel = 'Merkmale';
protected static ?string $modelLabel = 'Merkmal';
// protected static ?string $modelLabel = 'Merkmale';
protected static ?string $title = 'Merkmale';
protected static ?string $title = 'Merkmal';
public $projekte_id;
// public function mount(): void
// {
// dd($this->projekte_id);
// // $this->data = $this->ownerRecord;
// }
// $livewire->ownerRecord or $this->ownerRecord
public function table(Table $table): Table
{
return $table
->striped()
->query(fn (): Builder => Merkmale::where('projekte_id', $this->projekte_id))
->defaultSort('code')
->columns([
TextColumn::make('name'),
])
@@ -51,8 +45,15 @@ class WidgetMerkmale extends TableWidget
->maxLength(255),
]),
DeleteAction::make()
->modalHeading('Merkmal löschen')
->color('gray')
->iconButton(),
->iconButton()
->after(function ($record) {
OrientierungZuAbschlaege::where('projekte_id', '=', $record->projekte_id)
->update(
[$record->code => 0]
);
}),
])
->headerActions([
Action::make('name')