Blog Detail

18

Aug
Add Useful Aliases for Sail Commands to zsh Shell in Laravel cover image

arrow_back Add Useful Aliases for Sail Commands to zsh Shell in Laravel

Laravel Sail is a plugin that adds some useful aliases for sail commands to the zsh shell.

  • It will auto-discover sail executable and you can run its aliases from any Project Directory.
  • It provides auto-completion for artisan and composer commands when you use sail.
  • It also has s cinit alias for installing composer Dependencies and s ninit for installing npm Dependencies on your project, when sail is not installed.

Installation

  • You must install oh my zsh + git to use this plugin.
  • After installing git and Oh My Zsh run the command below
 git clone https://github.com/ariaieboy/laravel-sail ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/laravel-sail
  • Now edit zsh config file located in ~/.zshrc
  • Add laravel-sail to your zsh config plugins
  • Start a new terminal session and use the aliases

Usage

Pre Sail Installation Commands

Alias Description
s cinit 80 run composer install --ignore-platform-reqs using php version 8.0 - default php version is 8.1
s ninit 16 run npm install using node 16 - default node version is 17

General

Alias Description
s sail
sup sail up
sud sail up -d
sdown sail down
sb sail build
sbn sail build --no-cache

General Artisan Commands

Alias Description
saqw sail artisan queue:work
saql sail artisan queue:listen
sasw sail artisan schedule:work
sasr sail artisan schedule:run

Artisan and Dependencies

Alias Description
sa sail artisan
sp sail php
sc sail composer
sn sail npm
spn sail pnpm
sy sail yarn

npm build commands

Alias Description
swatch sail npm run watch
sdev sail npm run dev
sbuild sail npm run build
sprod sail npm run production

For more details, Please visit Github.

Closing Notes

If you are a company and want to utilize Laravel for your next PHP-based web application, CRM Software, E-commerce application, SAAS application, or any custom web application development for your custom requirements, you must discover an amazing team with experience in the Laravel framework. So Codebrisk is here to help you with your tailored requirements regarding Laravel Development. Please feel free to get in touch with us, or you can get a free estimate of your project here.

Published at : 18-08-2022

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

Launch your project

Launch project