Add bot run job
All checks were successful
Deploy App / deploy (push) Successful in 9s

This commit is contained in:
2025-08-31 14:46:51 +02:00
parent 75be85e608
commit 77ebc6bce1
2 changed files with 31 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire;
use App\Jobs\RunBot;
use App\Models\Bot;
use Illuminate\Support\Facades\Auth;
use Jantinnerezo\LivewireAlert\Facades\LivewireAlert;
@@ -62,9 +63,7 @@ class BotsList extends Component
public function confirmRunBot(Bot $bot): void
{
// Dispatch the job to run the bot
$class = new $bot->class($bot->config ?? []);
$class->run();
dispatch(new RunBot($bot));
flash()->success("Bot '{$bot->name}' is being executed.");
}