DEV Community

Jérôme W
Jérôme W

Posted on • Edited on

4 3

How to start Laravel project with "sail up" instead of "./vendor/bin/sail up"

Image description

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


Enter fullscreen mode Exit fullscreen mode

And paste this :



if [ -r ~/.bashrc ]; then
   source ~/.bashrc
fi


Enter fullscreen mode Exit fullscreen mode

Exit and save the modification.

Step 2

Still in your terminal, run this to open your .bashrc file :



nano ~/.bashrc


Enter fullscreen mode Exit fullscreen mode

And paste this :



alias sail='bash vendor/bin/sail'


Enter fullscreen mode Exit fullscreen mode

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


Enter fullscreen mode Exit fullscreen mode

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


Enter fullscreen mode Exit fullscreen mode

❓ 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! 😀☕

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay