Open terminal
Type: echo $SHELL
If the output is /bin/zsh, you're using Zsh (default on macOS Catalina and later). Otherwise, you might be using Bash.
For Zsh:
nano ~/.zshrc
For Bash:
nano ~/.bash_profile
Add the Alias: Add the following line to create an alias for example php artisan
:
alias art="php artisan"
Save and Close:
In Nano, press Ctrl + O to save, then press Enter. Press Ctrl + X to exit.
Apply the Changes: Reload your shell configuration by running:
source ~/.zshrc # For Zsh
source ~/.bash_profile # For Bash