# Laravel Commands Shortcut 'crn'

sudo nano /usr/local/bin/crn   # paste above content

#!/bin/bash
# Always run from /var/www/web
cd /var/www/web || { echo "Directory /var/www/web not found"; exit 1; }
if [ $# -gt 0 ]; then
# Run directly if arguments were given
exec sudo -u www-data php artisan "$@"
else
# Otherwise prefill and let you continue typing
read -e -i "sudo -u www-data php artisan " cmd
eval "$cmd"
fi

sudo chmod +x /usr/local/bin/crn



## test
crn import:ap
