Run the artisan command, no matter where you are in the project tree

v1.0.0 2019-02-26 22:32 UTC

This package is auto-updated.

Last update: 2024-05-28 05:33:41 UTC



This script will recursively look for the artisan command down the directory tree and execute it for you, no matter where you are in the project tree.


Install globally through composer

composer global require antonioribeiro/artisan-anywhere

Or download the raw file to your /usr/bin and make it executable

sudo wget -q -O /usr/local/bin/artisan \

sudo chmod 755 /usr/local/bin/artisan

or clone the repo and link it

sudo git clone /etc/laravel-anywhere

sudo ln -s /etc/laravel-anywhere/ /usr/local/bin/artisan

sudo chmod 755 /usr/local/bin/artisan


Once installed, by running artisan from your project directory you should get

$ artisan
Artisan found at /Users/antoniocarlosribeiro/code/pragmarx/
Laravel Framework 5.5.28

  command [options] [arguments]


Execute Artisan from anywhere in your Laravel project tree

Let's suppose you went for a walk, far down the Illuminate tree and, being in

$ cd /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations

and you need to run tinker, to test some stuff. Well... you have some options:

php ../../../../../../../../artisan tinker

php /var/www/laravel artisan tinker

cd /var/www/laravel ; php artisan tinker

or just

artisan tinker



Pull requests and issues are more than welcome.