protected function getCreateFormAction(): Action { return Action::make('create') ->icon('heroicon-s-shopping-cart') ->label('Create an Order') ->action(fn (CreateOrder $livewire) => $livewire->create()) ->requiresConfirmation() ->modalHeading('Confirm the Order') ->modalDescription('Do you confirm that the order is correct?') ->modalSubmitActionLabel('Confirm') ->keyBindings(['mod+s']); }
$livewire->create()
Actions\Action::make('import') ->icon('heroicon-m-arrow-up-tray') ->label('Import') ->color('info') ->form([ Forms\Components\FileUpload::make('file') ->label('Excel file') // ->... ->required() ]) ->action(function ($data, $livewire) { // Do the import thing // Close this modal and open another modal for displaying the import result $livewire->dispatch('open-modal', id: 'result'); $livewire->dispatch('open-modal', id: 'result-action'); // Also tried this, the result modal does not appear either })
Actions\Action::make('result') ->modalContent(new HtmlString('<div>Hello</div>')); // Test string
CreateRecord
protected function getCreateFormAction(): Action { return Action::make('create') ->icon('heroicon-s-shopping-cart') ->label('Create an Order') ->submit('create') ->requiresConfirmation() ->modalHeading('Confirm the Order') ->modalDescription('Do you confirm that the order is correct?') ->modalSubmitActionLabel('Confirm') ->keyBindings(['mod+s']); }
getSaveFormAction()
getCreateFormAction()
Action::make('save')
Action::make('create')
$this->data