bot->name . '?') ->asConfirm() ->onConfirm('confirmRunBot') ->show(); } public function confirmRunBot(): void { $log = $this->bot->logs()->create([ 'status' => 'pending', ]); // Dispatch the job to run the bot dispatch(new RunBot($this->bot->id, $log->id)); flash()->success("Bot '{$this->bot->name}' is being executed."); } public function render() { return view('livewire.view-bot'); } }