This commit is contained in:
2025-06-12 21:35:15 +05:00
parent e72f494da7
commit 66af4f913a

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Process\Pipe;
use Illuminate\Support\Facades\Process;
class GitPullController extends Controller
@@ -13,9 +14,12 @@ class GitPullController extends Controller
'command' => ['sometimes', 'string']
]);
$result = Process::path(base_path())->run(
$request->filled('command') ? $request->filled('command') : 'git pull'
);
$result = Process::pipe(function (Pipe $pipe) {
$pipe->command('ls -la');
// $pipe->command('grep -i "laravel"');
}, function (string $type, string $output) {
echo $output;
});
return [
'successful' => $result->successful(),