Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Dashed\DashedEcommerceCore\Livewire\Orders;
- use Filament\Actions\Action;
- use Filament\Actions\Concerns\InteractsWithActions;
- use Filament\Actions\Contracts\HasActions;
- use Filament\Forms\Concerns\InteractsWithForms;
- use Filament\Forms\Contracts\HasForms;
- use Livewire\Component;
- use Dashed\DashedEcommerceCore\Models\Order;
- class ChangeOrderFulfillmentStatus extends Component implements HasForms, HasActions
- {
- use InteractsWithForms;
- use InteractsWithActions;
- public $order;
- public $fulfillmentStatus;
- public function mount(Order $order)
- {
- $this->order = $order;
- $this->form->fill([
- 'fulfillmentStatus' => $order->fulfillment_status,
- ]);
- }
- public function render()
- {
- return view('dashed-ecommerce-core::orders.components.change-fulfillment-status');
- }
- public function changeStatusAction(): Action
- {
- return Action::make('change')
- ->label('Verander fulfillment status')
- ->color('primary')
- ->form([
- Select::make('fulfillmentStatus')
- ->label('Verander fulfilment status')
- ->options(Orders::getFulfillmentStatusses())
- ->required(),
- ])
- ->requiresConfirmation()
- ->action(function ($data) {
- dd($data, $this->order);
- })
- ->slideOver();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement