This commit is contained in:
DigitalInfinity committed 2026-06-02 17:11:39 +00:00
1 parent 00bcaa2b93
commit 1559580ceb
37 files changed
+211 -162

No files matched your search

@@ -34,40 +34,48 @@ class OrderForm
->columnSpan(1),
Select::make('user_id')
->label('Bestellt von')->inlineLabel()
->relationship("user", "name")
->relationship('user', 'name')
->required()
->default(filament()->auth()->user()->id),
Select::make("orderstatus_id")
Select::make('orderstatus_id')
->label('Bestellstatus')->inlineLabel()
->relationship("orderstatus", "name")
->visibleOn(["edit"])
->prefixActions([
Action::make('bestellt_single')
->icon(Heroicon::ShoppingCart)->label("Bestellt")->action(function(Model $record) {
$orderstatusBestellt = Orderstatus::where("name", "bestellt")->first();
$record->orderstatus_id = $orderstatusBestellt->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id,]));
})->visible(function(Model $record) {return ($record->orderstatus->name == 'erfasst');}),
Action::make('angekommen_single')
->icon(Heroicon::BuildingOffice)->label("Angekommen")->action(function(Model $record) {
$orderstatusAngekommen = Orderstatus::where("name", "angekommen")->first();
$record->orderstatus_id = $orderstatusAngekommen->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id,]));
})->visible(function(Model $record) {return ($record->orderstatus->name == 'bestellt');}),
Action::make('genommen_single')
->icon(Heroicon::Check)->label("Genommen")->action(function(Model $record) {
$orderstatusGenommen = Orderstatus::where("name", "genommen")->first();
$record->orderstatus_id = $orderstatusGenommen->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id,]));
})->visible(function(Model $record) {return ($record->orderstatus->name == 'angekommen');}),
Action::make("url_oeffnen")->icon(Heroicon::Link)->label("URL öffnen")->url(function (Model $record) { return $record->url;}, true),
]),
->relationship('orderstatus', 'name')
->visibleOn(['edit'])
->prefixActions([
Action::make('bestellt_single')
->icon(Heroicon::ShoppingCart)->label('Bestellt')->action(function (Model $record) {
$orderstatusBestellt = Orderstatus::where('name', 'bestellt')->first();
$record->orderstatus_id = $orderstatusBestellt->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id]));
})->visible(function (Model $record) {
return $record->orderstatus->name == 'erfasst';
}),
Action::make('angekommen_single')
->icon(Heroicon::BuildingOffice)->label('Angekommen')->action(function (Model $record) {
$orderstatusAngekommen = Orderstatus::where('name', 'angekommen')->first();
$record->orderstatus_id = $orderstatusAngekommen->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id]));
})->visible(function (Model $record) {
return $record->orderstatus->name == 'bestellt';
}),
Action::make('genommen_single')
->icon(Heroicon::Check)->label('Genommen')->action(function (Model $record) {
$orderstatusGenommen = Orderstatus::where('name', 'genommen')->first();
$record->orderstatus_id = $orderstatusGenommen->id;
$record->save();
redirect(OrderResource::getUrl('edit', ['record' => $record->id]));
})->visible(function (Model $record) {
return $record->orderstatus->name == 'angekommen';
}),
Action::make('url_oeffnen')->icon(Heroicon::Link)->label('URL öffnen')->url(function (Model $record) {
return $record->url;
}, true),
]),
DateTimePicker::make('orderdatetime')
->label('Bestellzeitpunkt')->inlineLabel()
->visibleOn(["edit", "view"])
->visibleOn(['edit', 'view'])
->disabled(),
])->columns(1);
}