Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Laravel Bash Aliases

Published on by

I don’t use a lot of aliases but I do rely on artisan autocomplete in ZSH. To try and improve my workflow I asked on Twitter if anyone had any useful Laravel bash aliases and had some great responses. Below is a list and I’m sure you will find some goodies:

Chris Fidao

alias ll="ls -lah" # List all, with human readable filesizes
alias c="clear" # Typing the whole word is annoying
alias h="cd ~/" # Go home
 
alias v='vagrant version && vagrant global-status'
alias vst='vagrant status'
alias vup='vagrant up'
alias vdo='vagrant halt'
alias vssh='vagrant ssh'
alias vkill='vagrant destroy'

This works with git status -sb, and will lint any PHP files that have been modified

alias lint="git status -sb | awk '/s/{print $2}' | sed 1d | xargs -n1 php -l"

Andrew Westrope

alias pa="php artisan"
alias par="php artisan routes"
alias pam="php artisan migrate"
alias pam:r="php artisan migrate:refresh"
alias pam:roll="php artisan migrate:rollback"
alias pam:rs="php artisan migrate:refresh --seed"
alias pda="php artisan dumpautoload"
alias cu="composer update"
alias ci="composer install"
alias cda="composer dump-autoload -o"

Sid

Saves quite a bit of typing

alias art="php artisan"

I added this one as I found myself absent-mindedly typing the whole word now and then

alias artisan = "php artisan"

Handy to add new domains to the host file after mapping on Homestead.yaml

alias edit-host="sudo pico /etc/hosts"

Reset and reseed database

alias db-reset="php artisan migrate:reset && php artisan migrate --seed"

Dwight Watson

I use one alias, and an SSH config.

alias hs="cd ~/Sites/homestead && vagrant up"

To get into the box, I put my SSH config file (~/.ssh/config):

Host homestead
HostName 127.0.0.1
User vagrant
Port 2222

Now, I can type ‘ssh homestead’ to get into the box. Might not be the shortest alias, but I find using the SSH config file makes it easy when you have lots of boxes/servers to get into all the time.

Jeremy Worboys

export PATH="vendor/bin:$PATH"
 
alias c='clear'
alias l='ls -FlAGh'
alias test="clear && phpunit"
alias art='php artisan'
alias pubkey="/bin/cat ~/.ssh/id_rsa.pub | pbcopy"
alias name="uname -n | tee /dev/ttys001 | pbcopy"
alias vapro="curl -L http://bit.ly/vaprobash > Vagrantfile"
alias chrome="/usr/bin/open -a /Applications/Google Chrome.app"
 
function convertarrays() {
curl "https://raw.githubusercontent.com/thomasbachem/php-short-array-syntax-converter/master/convert.php" -o convert.php
find . -name "*.php" ! -path "*vendor*" -exec php "convert.php" -w "{}" ;
rm convert.php
}

Yitzchok Willroth

Sorry, couldn’t resist… ;) Hope it made you smile.

alias phart='php artisan';

Do you have any that haven’t been mentioned? Share in the comments.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
SerpApi logo

SerpApi

Access real-time search engine results through a simple API—no more scraping headaches! Use it for AI applications, SEO tools, product research, travel information, and more

SerpApi
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud

The latest

View all →
DHH Joins Laravel Live Denmark 2026 for Fireside Chat with Taylor Otwell image

DHH Joins Laravel Live Denmark 2026 for Fireside Chat with Taylor Otwell

Read article
Model-Based Scheduling for Laravel with Cadence image

Model-Based Scheduling for Laravel with Cadence

Read article
Laravel's AI SDK adds sub-agents image

Laravel's AI SDK adds sub-agents

Read article
Laravel Introduces First-Party Passkey Authentication Support image

Laravel Introduces First-Party Passkey Authentication Support

Read article
Scrollbar Styling and Container Size Utilities in Tailwind CSS v4.3.0 image

Scrollbar Styling and Container Size Utilities in Tailwind CSS v4.3.0

Read article
Attach Addresses to Any Eloquent Model with Laravel Addressable image

Attach Addresses to Any Eloquent Model with Laravel Addressable

Read article