validate([ 'command' => ['sometimes', 'string'] ]); $result = Process::pipe(function (Pipe $pipe) { $pipe->command('ls -la '. base_path()); // $pipe->command('grep -i "laravel"'); }); return [ 'successful' => $result->successful(), 'errorOutput' => $result->errorOutput(), 'output' => '
'.$result->output().'', ]; } }