Laravel 9 Custom Login and Registration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi friends welcome to tutors funny Channel today I am going to teach user registration and login using laravel9 so here this is a simple uh user registration form I'm going to register the new user so I'm going to register new resources as to you email address St gmail.com password I am going to type one two three click save thank you that has been shape now I am going to go to the login page Log In so you type the email address St gmail.com so if your type wrong password you have to display the messages user or password invalid if you type the user login successfully here one two three login here it will be thank you the login has been displayed successful okay so how to do this system step by step will teach so first what I'm going to do is I'm going to go to the installer so first I'm going to get go to the if try I'm going to create the new folder project inside the folder I'm going to install The larva so type CMB go to the Google and type over here La rubber it goes to the respective website click here you have to find the version so get started laravel9 I am going to find the operating system Windows so you have here this installation you have to click on this one here we have our installation is there right so here uh you can go below you can hear your your first laravel project this is the way you have to install the laravel line Ctrl C to copy a so here back to my project so we are here foreign okay this is a project installation completed this is the current version it is installing now here laravel installation is completely now let's back to our project you can see you have a project app for folder has been created you open them double click and open it here inside the so inside here your all the project folder is there and file is there I am I'm going to open on the vs code editor you have to type CMD command on the address bar you have to type the type the command core space Dot and plus enter key you all the project will be open on the vs code editor right now if you want to run the project so type the command run you have to open the terminal over here here terminal new terminal here we have to type the command pH e Artesian so I want to go back now here you just copy this one now this is the URL I just copy and paste it here on the address bar you can see whether it's working fine or not now you can have a welcome screen of flower it will be displayed at welcome screen successfully now I am going to here this is the welcome screen okay now I am going to go to work make the registration form when the when we login we have to make the registration form so here first we have to do the step by step first you have to go to the right laravel web.ph you can see here here so uh before that sorry before that we have to go to the EnV file en file we have to first you have to create the database so go to the Low cross PSU my admin here where I am going to create the database dot create a new database is DB project adjust user name of the database DB project right here we now need to create the table and anything else over here we all the tables things we have created by the command go to the EnV file go to the MySQL configuration this is a MySQL configuration uh part so the database is MySQL DB database we have to write here DB project this is the database which we created file save R right this is a comma okay right this is a project name you must give the databases this is a properly okay this is a database name you have created the database right however that what I'm going to do is you go to the uh after that we have to we have a uh you can go to where you have to open another terminal this terminals we already have project is running you have to open the inner terminal so you can see here uh my uh inside the app folder we have a HTTP folder inside the HTTP folder we have a controller folder so inside the model you have to you can see that user.php is somewhere you have to create some model right it has a user name email and password okay this is the this is the user user account I am going to create use name your email and right so first what I'm going to do is I'm going to go to uh uh I'm going to go to uh go to the database migration so we have a table usage table you can see this is a user's table name email and password now here I am going to first PHP Artisan you have to run the command migrate right here your all the table has been migrated successfully now if you migrate that you can see here this is all the table the database tables you can come in here okay the MySQL registration path already we have a model is created now we have to register register the mod uh we have migrated so we have to go to the project gcp project you can have it all the tables okay here this is the users table okay we have to go into that email address password it will be sticky simple right now what I'm going to do is after that we have your model has been created successfully after we go to the flow which is here about Route 4 right inside the route for that web.ph okay this is the when the page is loaded it goes to the it is generating The View welcome so how to generate if the record is coming like this what I'm when it is calling to that welcome pitch it's called the welcome page it will reside on Via resource folder views will complete right okay here welcome is calling that will completion now what I'm gonna do is I'm going to go to we just remove this one your place to share the routes get triggers slash if the request is coming slash is close to the register controller class this is how we have right there in laravel 9 this is the standard you apply register call and column class you have to go to the method create right after that we have specified that your registration control is reside on where you have to specify over here we haven't created the registration controller right now so we have to how to create the registration control by command you have to type this one PHP Artisan May controller you'll write PHP artisan make colon colon sorry colon Contour colon controller you are facing the name of the control which is a register controller register control you have to type the register controller percentage your controller has been created successfully here it mentioned the path where your control is created is created here Ctrl gets created after that what I'm going to do is use slash use app http slash controllers folder app HTTP controllers folder here color effect right so here your control is reside on that http controllers and right sorry you have to mention the path controller what is the control you have created register controller okay so register control register control decide it on that app HTTP register controller that's it when when the request is coming its console register control is covered over here okay it is a it is a blank method this is only the class class register extend from the controller class this class okay section from the control class right Nokia what I'm going to do is the first step let's go to the register controller First Step what I'm going to do is first I have created the simple instead of writing I just copy and pastes don't worry I'll explain if I write and explain it takes this simple video it takes so much subscribe to complete it so here public method we have written public function create Open Bracket and close bracket inside the bracket return The View you have tried here over here you have to create one folder which is a contact okay we have to accept create separate separate fold this is a Content okay contact this is a folder and this is the file in exact create okay we have to create a register registration process we have to create you can give any name okay so here if you return the page first we have to the page is reside on Via inside the views folder views folder if you have to make the folder which is here contact folder contact folder we are right there go to create a file create the extension is blade dot PHP don't write only PHP you have write blade.php that's the standard right it will be visiting to this page but that's the thing we have to write now what I'm going to do is I'm going to go to uh the design so I have a design right so here we have created the layout page so you have to create a layout page so that inside the view this is a view okay so if you get the view for a select review folder right click you're right lay out dot blade dot PHP you also could have provided don't worry okay this call this course code we only write here HTML you say that HTML tag he said that this one the attack body tag okay so the HTML we have to paste the bootstrap links this one I have copied uh if you have any problem how to get this one adjust you just we have get we have to remove them go to the Post website boost at official side your type boost app click on this should have Boost of CDN copy only one line we have paste it that's it that's something simple stuff you need right oh that's a body check this one over here in the layout HTML if you write like this this is a uh right this is your HTML5 stand right this HTML5 standard right you have to write like this very simple okay if you want to this file we have to make it a simple way to write this one sorry by this one just tap you on your keyboard it will be created it will be created look like this only the changes you have to made it over here inside here HTML implementation inside the body now you have to explain how to write it inside the body you have to write a container class you're going to container class two of it here is the footer we have right it's a footer you can get copy from the bootstrap yeah I just copy from the bootstrap footer so you go to that you can just type boot step for photo footer I get it the photo from over here where the simple photo design photo example this one should be right so we have to start like this right only here this is a class you have to write it sorry this is a card you have like bootstrap card for card I get the one get them one card here you get get them one card the card design so God I change this like this design here this is a design I have to get it that is a core design I have to design right here this card editor card body that's why that's how I have to do this card secondary text y I will style this is a card body like this sound you have to copy it and write it very simple right here yield content we have yield the content whatever right this is this is this is the your template is just like a template only this content should be changed it is it's not if the uh we now need to call this page each and every Pages only this content should be changed entire website won't change only the content change right so here is correct trade blade.php here what I'm going to do is p up to registration page okay I already done the registration page so I will explain it don't worry you can see here X10 layout extend layout meet this is the extend layer this is the Styles we have to extend to this page section content section content means here this is the content yields content your quality then only this will be coming after that you have to stop it this is stopped right inside here we have to create a simple form design okay this is a simple form designed for the booster due class card is a card deal header this is header form Adder this is inside card body we have to create a simple form design okay this form tag is open and close it here action it's called the route register method first we have to add the csrs talk field this is must this is very much when you are doing the design csrf failures uh mask okay if the request is coming from the third party uh uh third part third party size it won't apply it won't add that accounts okay that's why it is for that purpose avoid that situation the CSS are token is for the security purpose okay it will be matching whether our form is our form or not okay so it's RF okay we added so here first name email and password the other three Fields first name right now let's save our now let's say write this simple form we have to create okay simple so now let's uh so here now what I'm going to do is when you click the submit save button whatever it goes to there this is all the form data which is goes to their route which is the register now now what I'm going to do is here I'm going to go to right I'm going to get this one I'll be explaining right it's close to the register out your caller register right it's register now class is it it is calling the store method okay store method which will be at the recording to the database so here what I'm gonna do is goes to the method which is a store method which will be adding the recording to the database so just copied and paste it over here a public function store it get the request what is the request you are sending from that form get the rate case all the requests are getting this variable if you have to get it over yes with your store we get all the reviews okay from this form uh the credit dot will email first name email and password it got all the records it will be getting okay it's getting all the records [Music] passing this request variable getting all the requesting the input this variable is all the record should be there after that what I did here is this is a Fields field name name email and password right so this name you have to change here as well uh the form field as a form this one should be the name the size or the name right side only if you have a first name you are given it's a name idios name email the same name you are matching to match into this field this use of it then only record should be added if you give the different name it won't add the same New Field name you have given over here right it will because so if you get money here registered right get the request and put in this variable you have a user model user model me this is user model this is a data user model you have to communicate with the database via the models right so there is a predefined function which is create here simple Json format here right name name this this all the fields are designed on our database feeds these are recital database name email and password this this data this phase we have set into a form tweet this is a form field get the request and send you the input field here this will sign in our input text Fields okay what is a text field we have to assign it here name email and password that password you are set it as password remember but why we make the password as Ash password it is a security purpose right while you when you type in the password on the particular text field uh see if someone next to you they easily understand what is your password you are typing okay they attempt to login your username and password when you are not alive so here that kind of situation you have to uh you have to protect your system you have to use this as keyword right okay after at the record correctly the return view into the contact of tanks.pissue page tax Dot Page so if you have to go to the contact for the right click get a file which is a tax dot blade dot PHP now here what I'm going to do is I'm going to get this one the same thing yes layout content the same content and layout so here we are by the simple card you have written a simple card here we have write the card Adder card Adder contact form she will display the message yes thank you this is the flow we are working now let's see about and check whether it's working fine or not back to our phone design reserve your refresh name uh the app it should write the problem is here not here registration controller we have to add this we have to call this model okay so you're right use app model s slash which is a model slash my user sorry foreign the web.php have the controller name I have to we have to give the same name that that is a problem I have a summer controller I had a problem with that the name is a problem now let's back over here now let's refresh it now here it's working perfectly it's working perfectly okay now we will be able to reset the user I'm going to register user as kishan email kiss gmail.com password one two three hit save button registration saved let's browse it's working forward okay now let's do the login path let's do the login part so first what I'm going to do is first I'm going to go to a routes so route section there I'll be there web.php we have to call that two things first one if it should be the outside will be explained.a second one is a check first one we have to go to the login form if if the uks is coming slash logging it's closer login controller so we have to con we have to stop the project and we have to create the controller again Ctrl C to stop the budget so to create the controller using this comma PHP artisan make control research login control so look at login now your login control has been created successfully here over here okay login controller so login controller so we have to create the login form so you have to copy these two things I'll be explained over here right now here first what I'm going to do is first you have to go to about uh when the application slash login it's also login controller index action method so here it's called a login controller this is a login controller index action method it returns to the view which is a login index so you have to create a folder this is a login folder you have to create a separate folder which is the login inside the views folder I'm going to create the separate folder login enter the login folder I'm going to create a file which has index dot blade dot PHP your character separate file in this file I'm going to paste this result uh the login design right now with a simple login form this one I already text the layout we have to extend it this is a section this is a section forget simple login form the bootstrap simple login form it's a card close schedule second one is a card header which is a login card body you have to declare free uh we have to we have a form tag and close tag we have a two fees one is a use email address another question is a password so email field is a password field here when you click login button which is submit by the score to the form which is up you have to check the route which is a check right you have to go to check routes so go to the login controller here we have to go to the action message check get all the key now here you can you can see here it's a login what is the username and password you're typing and click the login button it goes to the form action which is a uh check so what I'm going to do is okay when the request is coming it goes to the routes route section everybody's coming here check this goes to the check method check induction method of login controller okay so we login control we have made over here we have to use the path decided if you want to give the password correctly then only it will be working login control right now it's close to that login controller get your request what is the email address and password coming get the request and go to your make the variables a credential okay you have to validate email address and password this is the database field this is the form field it will be coming password the email address required password is required checking the iso there is a uh what what which is a it will be consist of uh we are passing out uh the resistance both you have to implement this all this resided in this namespace okay this is the second is a namespace okay this it is there or their password also has also you have to call it over here which is Ash password right so if you call it here you're right if or atom is credential it automatically check whether the email address and password is matching or not okay if it is matching it goes to the uh tank speed it is matching okay you have to go to the uh so yeah instead of that you have to uh putting another page and you can visit otherwise you can I just use a contact thanks otherwise you can do another thing yes yeah you can use the login page you have to create another page which is a uh uh login so you have to create another page which is a home page the home page of home Dot blade dot PHP so you have to redirect to this page when the login is successfully instead of the message okay so we have right uh inside login home page home page I have to uh the same thing go to the I just copied paste it in the home.blade.php page you have to select login support welcome home well come welcome right so it's called the welcome so let's save it okay right so the you can see here call it here login for this is a login folder the file which is a home is called to the home page but you are written here it will be written if you if if there is any error it's returning the error username or password invalid that's simple stuff you have deleted over here perfect now let's save our back to your browser now let's check the login credential login so request is coming login oh sorry I think foreign PHP artisan run again the server let's run it is login form I am going to type the uh user and password Here the password field is error now I'm going to register new user then we will be able to so we have to news usage slash not right Kumar Kumar gmail.com password one two three keep the name Kumar this one save save successfully now I'm going to go to test that uh login so login here we have to write Kumar at gmail.com password you have to give the wrong password username or password invalid you have to type the correct password welcome right so here if you are type the wrong URL if you are click the register it will be producer okay here this this URLs we have not mentioned over here okay when the use case if when you go to the register page you have to type slash okay right that's up it's working if we are go to the login page you have this URL then only this one this action method will be calling once you visit the URL only it will be called okay that's why it will be telling this one okay don't call like this so we have tried first register page after that login page thank you for watching if you have any doubt you can ask me anytime if you love my Channel Please Subscribe me like me thank you for watching
Info
Channel: Tutus Funny
Views: 16,388
Rating: undefined out of 5
Keywords: Laravel 9 Login and Registration, laravel tutorial, laravel 9, laravel login, laravel, login and registration laravel, custom login register, laravel9, laravel tutorial for beginners step by step
Id: nFbduFGimCI
Channel Id: undefined
Length: 32min 50sec (1970 seconds)
Published: Mon Feb 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.