Basic Laravel Login and Registration using Laravel Breeze
Tags: laravel, php, webdev, beginners
Published: 2020-11-14 02:17:12

Hello, How are you doing, I want to introduce Laravel Breeze to you, in the course of the week Taylor Otwell (creator of Laravel) tweeted about a new package released (Laravel Breeze). ![Taylor Tweet](https://res.cloudinary.com/kingsconsult/image/upload/v1605316055/laravel%20breeze/1_d5lqji.png) This is because of the uproar about Jetstream where some thought that Laravel have abandoned their legacy UI, but Taylor cleared the air on that, and have to release another package that is not complicated like the Jetstream and in which one can customize to his/her desire. 
This comes with basic Authentication like, User registration and user Login, change of password, email setup, send email for change of password, tailwind and blade etc. Let's create our first app with Laravel breeze.

If you prefer to watch videos, this is the video [Youtube Video link](https://youtu.be/0S15GNx_32U)

Click on my [profile](https://dev.to/kingsconsult) to follow me to get more updates.

### **Step 1: Install a new Laravel app**
You can use
> laravel new breeze

![laravel new breeze](https://res.cloudinary.com/kingsconsult/image/upload/v1605316055/laravel%20breeze/2_srninx.png) ![laravel new breeze](https://res.cloudinary.com/kingsconsult/image/upload/v1605316054/laravel%20breeze/3_lqm2nf.png)
but in using this, you must make sure laravel is installed on your system, you can install laravel globally using
> composer global require laravel/installer

or you can install laravel using composer without Laravel using
> composer create-project laravel/laravel breeze --prefer-dist

![composer create-project](https://res.cloudinary.com/kingsconsult/image/upload/v1605316054/laravel%20breeze/4_pdx5sk.png) ![composer create-project](https://res.cloudinary.com/kingsconsult/image/upload/v1605316054/laravel%20breeze/5_mzgi3b.png)

### **Step 2: Require Laravel Breeze**
After installing Laravel, then change into the directory **cd breeze/** and require Laravel Breeze with composer using the command below
> composer require laravel/breeze --dev

![require breeze](https://res.cloudinary.com/kingsconsult/image/upload/v1605316055/laravel%20breeze/6_cg01aj.png)

### **Step 3: Install Laravel Breeze**
> php artisan breeze:install

![install breeze](https://res.cloudinary.com/kingsconsult/image/upload/v1605316055/laravel%20breeze/9_wfr8sf.png)

### **Step 4: Install the JavaScript pacakges**
After installing Laravel Breeze, it will prompt you to run
> npm install && npm run dev

### **Step 5: Setup Database**
Open your **.env** file that was created and you will see that the  name of the project has automatically be entered as the database name, you can change it to the name of the database you want to use, or you leave it and create a new database with the name
![.env](https://res.cloudinary.com/kingsconsult/image/upload/v1605316054/laravel%20breeze/7_t52d9e.png)
### **Step 6: Run migration**
After setting up our database and editing it in the **.env** file, we need to run the migration, but before that, we need to set the default string length, if not, this will throw errors in the course of migrations.
Go to **app/Providers/AppServiceProvider.php** and add the schema for the default string length in the **boot** method.
> Schema::defaultstringLength(191);

remember to call the schema class at the top
> use Illuminate\Support\Facades\Schema;

```
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;


class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultstringLength(191);
    }
}
```
then run the migration
>  php artisan migrate

![migrate](https://res.cloudinary.com/kingsconsult/image/upload/v1605318242/laravel%20breeze/10_htkzu1.png) 

### **Step 7: Add your email login details**
This is so we can be able to reset our password and other email features
![email settings](https://res.cloudinary.com/kingsconsult/image/upload/v1605316054/laravel%20breeze/8_acbi66.png)
### **Step 8: Start the App**
> php artisan serve

**http://127.0.0.1:8000/**
![home page](https://res.cloudinary.com/kingsconsult/image/upload/v1605319431/laravel%20breeze/13_uepfir.png)
**http://127.0.0.1:8000/register**
![register](https://res.cloudinary.com/kingsconsult/image/upload/v1605319371/laravel%20breeze/10_pa1g14.png)
**http://127.0.0.1:8000/dashboard**
![dashboard](https://res.cloudinary.com/kingsconsult/image/upload/v1605319371/laravel%20breeze/12_fa61yz.png)
**http://127.0.0.1:8000/login**
![dashboard](https://res.cloudinary.com/kingsconsult/image/upload/v1605319371/laravel%20breeze/11_elo3bh.png)
Now you have your basic laravel app with Auth setup.
Follow me for more of my articles, you can leave comments, suggestions, and reactions.
I am open to any vacancy as a PHP backend engineer, my strength is in the Laravel framework 

Watch the video on [Youtube](https://youtu.be/0S15GNx_32U)
[click the link to view my profile and follow me] (https://dev.to/kingsconsult)