Laravel 8 Login and Registration With Custom Field

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to my channel in this video i am going to show you how to create login and register page using laravel ui packets laravel ui is a very simple authentication scaffold built on the bootstrap css framework if you have not subscribed or signed already please do subscribe and let's get started first of all let's open the git bus and here you need to go to inside the sd docs and here you can see here we are going inside the project directory where we need to install laravel project let's install the laravel project laravel new laravel iphone auth laravel auth is my project name so to install our project it might take a couple of minutes so let's wait for it all right our larabee project is installed now let's go inside the project directory and let's run the php artisan server copy this url and run this from browser all right here you can see a lot of projects is set up and in the header section we don't have anything okay now let's install the laravel ui package for that let's run the command composer required laravel ui so let's wait for it now let's run the php artisan here you can see all the list of commands that you can use inside ui you can see ui colon auth and let's run it it will set up the login and registration views and routes so let's go to the browser and run it here in the top section you can see we have login and register once you click on login you can see login form which is not looking good and once you click on register you will see the registration pump and which is also not looking good so let's install the bootstrap you can run php addition ui iphone iphone health to see all the presets here you can see we have different type of presets bootstrap view react and let's install the bootstrap for that php artisan ui bootstrap all that bootstrap is also now installed now here you can see we need to run npm install and npm run dev so let's run it observe some issue it might be because of this spacing so let's type it again installing npm and npm one day it might take a couple of minutes so let's wait for it [Music] let's run the npm round dip once again all right project is compiled successfully so let's run the project php artist installed let's refresh the browser and if you click on login here you can see we have a pretty good screen now and also for the register we have a good screen now let's create an account [Music] once you click on register here you can see no connection could be made because the target machine actively refused it is because of the database connection issue so make sure you have created a database if not now let's start the jam server before creating a database so let's restart our path and my scroll and let's go to the localhost phpmyadmin here we'll create a database click on new and give the database name whatever you want for me it's laravel on the scroll and click on create all right we have created the database now let's set up this in environment file so let's go to the env file you can click on enb and provide all the database details tv collection will be mysql db host will be localhost r127.0.01 you can give the database name username and the password of your database all right now let's run the migration file before that let me clean this screen let's run the microstrip command php artisan migrate here you can see we have a users table and also the password and the jobs table so let's get back to the database and here you can see all the tables are created in the users table you can see we have name email and other fields now let's run the project once again here let's register the account from that you can provide the name email password and confirm password click on register all right we have successfully created our account now here in the users table you can see we have all the details of that account all right let me log out that and let me login from login page and here we are able to successfully login our user to restart the password you can click on reset password and you can provide the email address but to send the email you need to provide the mail configuration on env file for that i'm going to escape right now now let's get back to the web.php here you can see all routes this will handle all the routes for the authentication here in the authentication section you can see we have login controller okay and you can also change this route service provider currently it is pointing to the home page if you want to make other default then you can update that as well here in the home equals 2 you can see slash home if you want to put different route then you can update this one all right now let's add some other fields in the registration form here i'm going to add address as a new field for that you can provide the address over here and now let's get back to the model and here also in the fillable you need to add address and then you need to update the migration file let's go back to the migration it's inside the database migration you can see users table and here you can add that field instead of adding new field there let's make the new migration file php artist make migrate add address to users here you can provide the table name and it will be users for me now it will create a new migration file let's go to the migration here you need to add address okay to provide the rollback option you need to add drop column in down function once you do migrate roll back it will drop this address all right let's run the migration now you can see new field is added in our users table and here you can refresh and see address is added at the last actually i wanted to add this after the email sections but it is at the last so let's add after method over there and i also want to make it knowledgeable you can provide the parameters like true or false but by default it will be true now let's run php artisan micro rollback it will remove the field from the table and now let's run the migrate again okay all right our new field is added and it will be after the email field here you can see address is added after the email and it is knowledgeable now let's run the project php address and solve and let's back to the browser and here you can refresh and you can go to the register in register section you can see name email address password confirm password we don't have that address available right now so we need to update the blade file for that you can go inside the inside the resources views alt and you can click on the register.blade.php here you can add that field okay i'm going to update this [Music] [Music] all right now save this now let's get back to the browser and displace the page here you can see we have address all right now let's provide the details and you can see this email is already registered so let's create a new one okay now click on register here you can see on define arrow key i think something we missed in the blade file so let's go back to the blade file okay address and i think there is something missing okay name equals to you can see name but it should be address all right let's save this and run it once again provide the details over here all right we have successfully added a new field in our users table as well so this is the way you can customize and you can create login and register base in laravel in future we'll create other videos with bridge and jt stream so keep in touch if you like this video please hit the like button and don't forget to subscribe our channel thank you for watching till now you
Info
Channel: Naran Code
Views: 8,068
Rating: undefined out of 5
Keywords: laravel, laravel tutorial, laravel authentication, laravel auth, laravel login, laravel authentication tutorial, authentication in laravel, laravel login and registration, laravel login tutorial, laravel registration, laravel login and registration authentication, laravel register user, laravel authentication using jetstream, how to make login and registration in laravel 8, login and registration with custom field, login and registration with laravel breeze, narancode
Id: SuhtZ_IlX7k
Channel Id: undefined
Length: 12min 16sec (736 seconds)
Published: Sun Aug 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.