b2c1af91d3e70ea442ae5353cf7f140d89491c73

Author
John Hamelink <john@johnhamelink.com>
Committer
John Hamelink <john@johnhamelink.com>
Date

Message

Added laravel plugin which gives aliases to artisan and bob, and
provides autocompletion for artisan.

Diff

 1diff --git a/plugins/laravel/_artisan b/plugins/laravel/_artisan
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..8637514cfe97ccf0ce40d208b46c68ebbb8f86bb
 4--- /dev/null
 5+++ b/plugins/laravel/_artisan
 6@@ -0,0 +1,40 @@
 7+#compdef artisan
 8+
 9+# Laravel autocompletion
10+# Author: John Hamelink <john@johnhamelink.com>
11+#
12+# This plugin does the following:
13+#  - Adds aliases and autocompletion for artisan
14+#  - Adds aliases and autocompletion for bob
15+
16+local curcontext="$curcontext" state line _opts _bundles ret=1
17+_arguments -C \
18+    '1: :->cmds' \
19+    '*:: :->args' && ret=0
20+
21+case $state in
22+    cmds)
23+
24+    _values "Artisan command" \
25+        'session\:install[Create a session table]' \
26+        'migrate[Manage Migrations]' \
27+        'test[Run a test]' \
28+        'route\:\:call[Call a route in the CLI]' \
29+        'key\:\:generate[Generate a key]'
30+        ret=0
31+        ;;
32+    args)
33+        case $line[1] in
34+            migrate)
35+                _values \
36+                    'install[Create the Laravel migration table' \
37+                    'make[Create a migration]' \
38+                    'rollback[Roll back to the last migration operation]' \
39+                    'reset[Roll back all migrations that have ever run]'
40+                ret=0
41+                ;;
42+        esac
43+        ;;
44+esac
45+
46+return ret
47diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
48new file mode 100644
49index 0000000000000000000000000000000000000000..ed932ee89fae5965f74bdad6cd65a18cfa696640
50--- /dev/null
51+++ b/plugins/laravel/laravel.plugin.zsh
52@@ -0,0 +1,3 @@
53+#!zsh
54+alias artisan='php artisan'
55+alias bob='php artisan bob::build'