“Laravel Execute Command do Terminal” Respostas de código

Executar o comando artesão do controlador

If you have simple job to do you can do it from route file. 
For example you want to clear cache. In terminal it would be php artisan 
cache:clear In route file that would be:

\Artisan::call('cache:clear');
Lokesh003

Laravel Execute Command do Terminal

php artisan command:name
Thoughtless Tortoise

Artesão Make Command

php artisan make:command CommandName
RaFiNhA90

Execute o comando Shell em Laravel

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();
lalala

Comando do Laravel Run

class MyCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'my:command';
}


php artisan my:command

MrDracoula

Respostas semelhantes a “Laravel Execute Command do Terminal”

Perguntas semelhantes a “Laravel Execute Command do Terminal”

Mais respostas relacionadas para “Laravel Execute Command do Terminal” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código