Jump to: navigation, search

Artisan Tab Completion

Thanks to https://github.com/janka/artisanBashCompletion for this hotness!

From your home directory run the following.

git clone git@github.com:janka/artisanBashCompletion.git
echo "alias artisan='php artisan'" >> .bash_profile
echo ". artisanBashCompletion/artisan" >> .bash_profile

You now need to copy the listForBash.php file to app/commands:

cp artisanBashCompletion/listForBash.php public_html/app/commands

Then you will need to register this new command with laravel.

Edit app/start/artisan.php and add:

Artisan::add(new listForBash);

You can now tab complete artisan while inside a laravel home directory.

deving@server2:~/public_html (master)$ artisan [TAB][TAB]
asset:publish         controller:make       generate:model        key:generate          migrate:rollback      tinker
auth:clear-reminders  db:seed               generate:pivot        list                  optimize              up
auth:reminders        down                  generate:resource     list:forBash          queue:listen          view:publish
cache:clear           dump-autoload         generate:scaffold     migrate               queue:subscribe       workbench
changes               env                   generate:seed         migrate:install       queue:work
clear-compiled        generate:controller   generate:test         migrate:make          routes
command:make          generate:form         generate:view         migrate:refresh       serve
config:publish        generate:migration    help                  migrate:reset         session:table
deving@server2:~/public_html (master)$ artisan