How to authenticate or login with email or username using Laravel + Breeze + InertiaJS.

Patrick Curl
Geek Culture
Published in
3 min readAug 11, 2021

--

To keep users happy user experience is everything. As a developer it’s also nice when code just looks pretty and is extremely functional.

Apps like Reddit for example you may not want to require a name. What I do on those is make the name nullable or sometimes replace it with a first name/last name fields. You might also want a username that’s also a slug for that user account.

The flow that we’re building in this tutorial is basically this:

Register and supply email, username, password. On the profile, you can have other fields like name, phone, etc. Login will just have a username/email field, and password.

We could go with Laravel Jetstream which is nice for many reasons but sometimes it’s nice to have more control over how everything fits together. That’s why we’re using Laravel breeze.

To start this we’re going to follow the guide which basically says we need to :

  1. Create a new laravel app.
  2. Setup the database connection.
  3. Install Breeze.
  4. Run npm and migrations.

This might look like this:

--

--

Patrick Curl
Geek Culture

I write about AI and tech news, and am building some cool stuff with AI Agents. Subscribe for free to bypass paywalls: https://curl.beehiiv.com