Create alias for php artisan
Posted: 2025/03/20
While learning Laravel, I need to type command php artisan a lot. And many times, I always mistyped it to php atrisan or php artian. So it's better to create an alias to save time and avoid mistake.
I will make an alias a for php artisan on my Macbook (default shell is zsh)
Edit shell's configuration file:
nano ~/.zshrc
Add this line
alias a="php artisan"
Apply the change
source ~/.zshrc
Now I can use the alias across terminal sessions and it also works after system reboots.
For example, to use tinker, I can use this
a tinker
This is awesome!