DEV Community

Martin Betz
Martin Betz

Posted on • Originally published at martinbetz.eu 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

Source: https://twitter.com/Martin_Betz/status/1256610649716723716

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

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay