This tutorial explains how to create a shorcut in your terminal to allow you to start your Laravel project with sail up
command instead of ./vendor/bin/sail up
using .bashrc in MacOS.
There are only 2 little steps!
Before starting
First, you need to open your terminal. Simple, isn't ? 😂
Step 1
In your terminal, run this to open your .bash_profile
file :
nano ~/.bash_profile
And paste this :
if [ -r ~/.bashrc ]; then
source ~/.bashrc
fi
Exit and save the modification.
Step 2
Still in your terminal, run this to open your .bashrc
file :
nano ~/.bashrc
And paste this :
alias sail='bash vendor/bin/sail'
Exit and save the modification.
The final word 💬
Here we go, you can now open any Laravel project using Sail and write the following command to start it :
sail up
Personally, I'm using the Docker's detached mode to free my terminal and be able to use it directly. This consists of adding -d
like this :
sail up -d
❓ Notice that I showed 2 steps but depending on your OS environment, you could probably skip the step 1.
Thanks for reading this little tip, feel free to add a comment to share your opinions! 😀☕
Top comments (0)