DEV Community

Martin Betz
Martin Betz

Posted on • Originally published at on

Quick setup Laravel (with Tailwind scaffold)

I often install a fresh Laravel app to test a new package or replicate the setup for a tutorial. This is the fastest way to get a vanilla Laravel with Auth and Tailwind. The first step is only required if you have not installed the Laravel installer before ($ means that you have to enter that to your terminal):

  • ($ composer global require laravel/installer)
  • $ laravel new project
  • $ cd project && code . (opens in VSCode)
  • Open .env
  • Change DB_CONNECTION=mysql to DB_CONNECTION=sqlite
  • Remove all lines not needed for SQLite: DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD
  • $ touch database/database.sqlite to create the SQLite database
  • $ composer require laravel-frontend-presets/tailwindcss --dev
  • $ php artisan ui tailwindcss --auth to scaffold Tailwind frontend
  • $ npm install && npm run dev to install the frontend
  • $ php artisan migrate to migrate the database
  • $ valet open or $ php artisan serve to open the site


P.S. If you want to automate the installation and add Git and some more, you might find Tighten Co's Lambo useful.

Top comments (0)