<?php
namespace App\Filament\Pages;
class extends Page
{
protected function getHeaderActions(): array
{
return [
Action::make('launchAction')
->color('success')
->label('Launch Server')
->after(function () {
// ...
try {
$process = Process::fromShellCommandline($command, $mcDir);
$process->setTimeout(null);
// Async process
$process->start();
} catch (Exception $e) {
Log::error('Failed to launch server: ' . $e->getMessage());
throw $e;
}
}),
];
}
}
<?php
namespace App\Filament\Pages;
class extends Page
{
protected function getHeaderActions(): array
{
return [
Action::make('launchAction')
->color('success')
->label('Launch Server')
->after(function () {
// ...
try {
$process = Process::fromShellCommandline($command, $mcDir);
$process->setTimeout(null);
// Async process
$process->start();
} catch (Exception $e) {
Log::error('Failed to launch server: ' . $e->getMessage());
throw $e;
}
}),
];
}
}