ЁЯФ╕ English:
Laravel Envoy is like a task runner. It helps you write simple scripts (in a file called Envoy.blade.php
) to run multiple commands on your server with just one command.
You donтАЩt need to manually SSH and type each command тАФ just write them once in Envoy and run them any time.
ЁЯФ╕ Hindi:
Laravel Envoy рдПрдХ рдРрд╕рд╛ рдЯреВрд▓ рд╣реИ рдЬрд┐рд╕рд╕реЗ рдЖрдк server рдкрд░ рдХреЛрдИ рднреА рдХрд╛рдо (рдЬреИрд╕реЗ deploy рдХрд░рдирд╛, migration рдЪрд▓рд╛рдирд╛, cache clear рдХрд░рдирд╛) рдПрдХ рд╣реА command рд╕реЗ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред
рдЖрдкрдХреЛ рдмрд╛рд░-рдмрд╛рд░ SSH рдореЗрдВ рдЬрд╛рдХрд░ command рдирд╣реАрдВ рдЪрд▓рд╛рдиреА рдкрдбрд╝рддреА тАФ рд╕рдм рдХрд╛рдо рдПрдХ Envoy script рдореЗрдВ define рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред
тЬЕ Real-World Example:
ЁЯОп Use Case:
You have a Laravel project hosted on a production server.
Whenever you push new code, you want to:
- Pull the latest code from Git
- Run migrations
- Clear cache
тЬЕ Basic Syntax (Envoy.blade.php
)
bladeCopyEdit@servers(['production' => 'user@your-server.com'])
@task('deploy', ['on' => 'production'])
cd /var/www/your-project
git pull origin main
php artisan migrate --force
php artisan config:cache
@endtask
Now run it like this:
bashCopyEditenvoy run deploy