Answers for "execute shell script file in laravel command"

0

execute shell script file in laravel command

use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;

$process = new Process('sh /folder_name/file_name.sh');
$process->run();

// executes after the command finishes
if (!$process->isSuccessful()) {
    throw new ProcessFailedException($process);
}

echo $process->getOutput();
Posted by: Guest on September-25-2021

Code answers related to "execute shell script file in laravel command"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language