Linux commands through Laravel

0

I'm creating some custom commands in Laravel as per the documentation: link

ex:

php artisan gestao:config

This command allows me to automatically configure some things in my application, such as migrate and Seeds of my application.

What I would like to know is if you can run beyond the Artisan commands, some native linux commands such as: sudo chmod -R 775 /var/www/laravel/storage

    
asked by anonymous 22.05.2017 / 03:34

1 answer

1

You can do this using the "process" component (laravel 5) link

You can also invoke PHP's own functions
link ,
link

Or, still in Laravel (4.2), the component SSH

Obviously, any of the media you choose requires levels of execute permission. This depends on the permissions on the Operating System.
I comment this because of the sudo in the command that presented in the question.

Which option to choose? It depends on what you want to do. There is no rule where it forces you to use Artisan or condemn you for using PHP's own functions.

    
22.05.2017 / 07:01