Laravel 9 Custom Auth Login Registration Tutorial - 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends in this video tutorial we will explain you how to create custom authentication login and registration under this laravel 9 application suppose you have used laravel framework for your web application development then you can find inbuilt default login and registration feature available under laravel 9 framework and you can simply enable this default authentication login registration by simply run command in command prompt but suppose you want to create your own custom authentication login and registration in your laravel 9 application then under this tutorial we are going to show you traditional method and by using this method you can create custom authentication in laravel 9 application this is because under this tutorial we have described simple method for build custom login registration and dashboard pages under laravel 9 application now let's start discussing this topic so this is our testing database and we will create user table under this database from laravel 9 application now we want to download laravel 9 application so we have goes to command [Music] prompt and here we have to run this command so this command will start downloading laravel 9 framework here we can see that it will takes more time to download laravel 9 framework file and now here we can see that laravel 9 framework has been downloaded in our computer now we want to check laravel 9 application in browser so we have run this command so this command will start laravel 9 application server and provide us base url now here in the browser we have pasted this base url so here in the browser we can see that laravel 9 application home page has been displayed now we have goes to text editor and here we can see directory structure of laravel application and first we want to make database connection so we have to open dot environment file and under this file we have to define mysql database name user name and password details so after define this configuration it will make mysql database connection now here in model directory we can see default user model class file already created so we will use this model class file for database operation after this here in database folder migration directory we can see default user table migration file already created now for create user table from laravel application so we have goes to command prompt and here we have run this command which will create user table under testing database now here in testing database we can see that blank user table has been created now we have to proceed for create custom login and registration application now we want to create controllers class file so we have goes to command prompt and here we have to run this command which will create sample controller class file under our laryvel application now here in text editor we have goes into application controller directory and open sample controller file and under this file first we have to write use statement with hash class name this class it will use for convert simple password to hash formatted password below this we have to write use statement with session class name this class we will use for store session information data about the user across the requests after this we want to include user model class so we have to write use statement with path of user model class file for database operation next we want to include laravel authentication class so for this here we have to write use statement with part of laravel authentication class now under this class we have to create index method which is root method of this class under this method we have to write return statement with view method and under this method we have to write login so it will load login.blade file in the browser now we have proceed for create blade template file so here in views directory we can see that we have already created some blade template file so first we have to open main.blade.php file which is master template file and under this file we have paste this html code and under this html code we have used bootstrap 5 library now here in bootstrap navbar navigation class we want to create login registration link which will be displayed to guest user and display logout link to login user so for this here we have to write at the rate guest director so this directive is used for identify guest user who is not login in our application so it will execute this block of code and here we have to write [Music] list tag with class as equal to navigation item class [Music] and between this we have to create anchor tag with classes equal to navigation link and after this we have to write href attributes as equal to blarevale expression and between this we have to write root function and under this function we have to write login so it will create link for ghost to login page and in anchor text we have to write login so it will create login page link same way for create registration page link so here we have to write list tag with classes equal to navigation item and between this we have to write anchor tag with classes equal to navigation link [Music] and after this we have to write href attribute as equal to glaruvale expression and between this we have to write root function and under this function we have to write registration so it will create link for goes to laravel page after this in anchor text we have to write registration so it will create links for goes to registration page but suppose user is login then here we have to write at the rate else directive so login user can view this block of link so here we have to display logout link so here we have to write list tag with class as equal to navigation item class and between this we have to write anchor tag with class as equal to navigation link and after this we have to write href attribute as equal to laravel expression and between this we have to write log out so it will create links for log out from laravel application after this in anchor text we have to write log out so it will create logout link now for close this guest directive so here we have to write end guest directive so this code will display logout link to login user and guest user can view login registration page link so here our navigation barcode is ready and this is master template and for display this navigation bar in child page also so for this here we have to write at the rate yield directive with name content so by using this directive child page will expense this template file now we have to open login.blade.php file and first we want to extends mainblade file so here we have to write at the rate extends directed with name main [Music] now we want to create section for display this page content with master template so here we have to write at the rate section with name content [Music] and first we have closed this section by writing at the rate end section directive with name content and between this block we can paste this html code of this login blade file now we want to display this navigation bar in the browser so first we have to create registration and logout method so we have goes to sample controller and here we have create registration method [Music] and after this we have create logout method so here we have create both method and for check output in the browser now we want to set root for index registration and logout method so we have to open web.php file from this roots directory and under this file first we want to include sample controller class under this file so here we have to write view statement with path of sample controller file after this for set root here we have to write root class with controller method [Music] and under this method we have to write sample controller class and after this we have to write group method with callback function so by using this code we can define multiple root under this callback function [Music] now under this function we have to write root class with get method with two argument in first argument we have to write login and in second argument we have to write index and after this we have to write name method with login so this code will set root for index method after this for set root for registration method so here we have to write root class with get method in first argument we have to write registration and in second argument we have to write registration after this we have to write name method with registration so it will set root for registration method after this we want to set root for logout method so here we have to write root class would get method with two arguments so in first argument we have to write log out and in second argument we have to write log out after this we have to write name method with name logout so it will set root of logout method now here in browser we have to write login after base url so here on web page we can see that login and registration link has been displayed on the webpage this is because currently we are not login into system when we have login into system then it will display logout link in place of login and registration link so in next part we will proceed for creating registration form so in next part we will make custom registration form under laravel 9 application
Info
Channel: Webslesson
Views: 25,594
Rating: undefined out of 5
Keywords: Laravel, laravel 9, authenticate, login, laravel login, laravel auth, laravel register, laravel custom auth, laravel custom auth login and registration, laravel custom login register, laravel9, laravel tutorial, authentication system, laravel authentication system, laravel 9 login and registration, laravel custom login and registration, laravel 9 authentication, laravel custom login authentication, laravel custom registration and login, register, registration, logout
Id: UPhb6ZDJzdI
Channel Id: undefined
Length: 11min 35sec (695 seconds)
Published: Wed Aug 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.