Using Laravel Envoy for common local development tasks

When I am developing locally I run a lot of Artisan commands on my VM and I have a memory like Dory (from Nemo). I can never remember the commands I need to run without looking.

So what I have done is setup Envoy with common tasks I run on my VM. Here is a quick example of my reset:

@servers(['vm' => '-p 2222 vagrant@127.0.0.1'])

@macro('reset')
    migrate_reset
    migrate_seed
    reload_elastic
@endmacro

@task('migrate_reset', ['on' => 'vm'])
    cd ~/Code/MyApp
    php artisan migrate:reset --env=local
@endtask

@task('migrate_seed', ['on' => 'vm'])
    cd ~/Code/MyApp
    php artisan migrate --seed --env=local
@endtask

Of course the opportunities are limitless for this and I’m really enjoying it.


Filed in: Laravel Tutorials


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

PHP Web Developer
Orlando, FL
Christ for all Nations
PHP Developer
Manhattan, KS (open to Remote)
CivicPlus
Mid-Senior Laravel Developer
Exeter
Optix Solutions
Full Stack Web Developer
Las Vegas, NV
V Shred
Staff Software Engineer (Laravel)
Remote
smartbnb
Software Engineer (PHP, Laravel, Vue)
Los Angeles, CA
Relocity
Software Engineer Level 1 / Level 2
St. Pete. / Tampa Area, FL / Remote
ShineOn