Laravel boilerplate

Dec 2023

I often create the same thing over and over again, using the same set of Laravel packages from one project to another.

I've already benefited a ton from the work that Dan, Liam, Ryan and others did on https://github.com/laravel-frontend-presets/tall but I wanted something that was truly one command to spin up a Laravel site.

So I put together the following .zsh script:

#!/bin/zsh

echo -n "What should the slug of the app be? "
  read MYVAR


cd /Users/stephenbateman/web &&
laravel new $MYVAR &&
cd $MYVAR && 
composer require livewire/livewire lorisleiva/laravel-actions iambateman/speedrun laravel-frontend-presets/tall predis/predis &&
composer require barryvdh/laravel-debugbar --dev &&
php artisan ui tall --auth &&
npm install

That lives in a utility folder, and then I call it using laravel-boilerplate, which is an alias:

alias laravel-boilerplate="./web/utility/laravel-boilerplate.zsh"

Pretty simple, but that allows me to write laravel-boilerplate and instantly get a new working app just the way I want.