validate([ 'command' => ['sometimes', 'string'] ]); $result = Process::path(base_path())->run( $request->filled('command') ? $request->filled('command') : 'git pull' ); return [ 'successful' => $result->successful(), 'failed' => $result->failed(), 'exitCode' => $result->exitCode(), 'output' => $result->output(), 'errorOutput' => $result->errorOutput(), ]; // return '
'.$result->output().''; } }