How to start Laravel project with "sail up" instead of "./vendor/bin/sail up"
JΓ©rΓ΄me W
Posted on May 31, 2022
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! πβ
Posted on May 31, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.