#!/bin/bash
if [ -f "./artisan" ]; then
php artisan "$@"
else
if [ "$1" == "create" ]; then
if [ ! `which git` ]; then
echo "For this installer to work you'll need to install Git."
echo ' http://gitref.org/'
fi
git clone --recursive git://github.com/laravel/laravel.git "./$2"
cd "$2"; chmod -R 0777 storage/
else
echo 'This is not a valid laravel installation so artisan is a bit lost.'
echo ' http://laravel.com/docs/install#installation'
fi
fi
保存为/usr/bin/artisan 并执行 chmod +x /usr/bin/artisan 赋予执行权限
然后,你就可以进入你的项目文件夹,只需输入bash命令 "artisan create myapp",就会自动从github上clone一份最新的Laravel框架,并会自动设置storage文件夹的权限。之后,你可以直接输入“ artisan xxxx xxx”的指令了,而不用输入'php artisan xxxx xxxx' 。