loginUsingId(1); $this->buttonText = __('Start'); } public function start() { $this->buttonText = __('Downloading...'); // Commands to run $projectFolder = base_path('../'); $command = [ sprintf('%srunpython.sh', $projectFolder ), ]; // Convert commands array to a single string $process = new Process($command); $process->setTimeout(3600); // stel een geschikte timeout in $process->start(); try { $myOutput = []; $process->wait(function ($type, $buffer) use (&$myOutput){ $this->stream(to: 'output', content: $buffer); $myOutput[] = $buffer; }); $this->output = collect($myOutput)->join('
'); } catch (ProcessFailedException $exception) { logger('error', $exception->getMessage()); echo $exception->getMessage(); } $this->buttonText = __('Done'); } public function render() { return view('livewire.download-form'); } }