Giter Club home page Giter Club logo

awesome-laravel-bash-aliases's Introduction

Awesome Laravel Bash Aliases

🚀 Curated list of useful Laravel bash aliases that will make your work easier. This list is not recommending that you use all aliases below, only those you may find useful in your Laravel Development lifecycle.

Inspiration

Working with bash in daily life, it is very irritating writing the same command multiple times. To avoid that we write aliases/snippets for bashrc and make our life easier.

This is a list of useful bash aliases that I've seen in use at Laravel conferences or organized events over the years.

Read Contribution Guidelines before contributing.

Contents

How To Use Aliases

First, open up the ~/.bashrc file in a text editor that is found in your home directory. Uncomment or add the following lines:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

This tells it to load a .bash_aliases file, if it exists, so you can put all your aliases in it and make them easier to share and keep up with. Finally, create the ~/.bash_aliases file and add the following as your first alias:

alias art="php artisan"

Save the file and type the following in the terminal:

source ~/.bashrc

From here on you should be able to type art and it’ll auto expand into php artisan. Just remember that every time you modify the bash_aliases file you’ll need to either run that source command or restart Terminal so the changes are picked up.

Laravel Framework

Artisan Console

alias art="php artisan"
alias p="php artisan"
alias pa"php artisan"
alias artisan="php artisan"
alias t="php artisan tinker"
alias pat="php artisan tinker"
alias artt="php artisan tinker"

Controllers

alias mc="php artisan make:controller"
alias mrc="php artisan make:controller --resource "

Database

alias mm="php artisan make:migration"
alias mmm="php artisan make:migration -m "
alias migrate="php artisan migrate"
alias mfs="php artisan migrate:fresh --seed"

Installation

alias laravel-installer="composer create-project --prefer-dist laravel/laravel "
alias key="php artisan key:generate"
alias serve="php artisan serve"

Logging

# Tail all Laravel Logs and filter out the stack traces:
alias viewlog='tail -f -n 450 storage/logs/laravel*.log \
                | grep -i -E \
                    "^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
                    --color'
alias rmlogs="rm storage/logs/laravel-*.log"

Testing

alias t="phpunit"
alias pf="phpunit --filter "
alias pg="phpunit --group "
alias du="php artisan dusk"
alias mt="php artisan make:test"
alias mtu="php artisan make:test --unit "

Composer

alias cdo="composer dump-autoload -o"
alias ci="composer install"
alias co="composer outdated"
alias cu="composer update"

Docker

alias d='docker'
alias dc='docker-compose'
alias dm='docker-machine'

Git

alias g="git"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gs="git status"
alias nah="git reset --hard;git clean -df"
alias wip="git add . && git commit -m 'wip'"

Other

alias _='sudo'
alias copyssh="pbcopy < $HOME/.ssh/id_rsa.pub"

License

CC0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.