Laravel Jetstream tutorial: Multi Auth

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there what's up guys today i'm going to show you how to make an app rather than multiple authentication app whereby you can have two um two routes that is an admin and a normal user so we're going to use it to we're going to implement it in in laravel using jet stream now we're going to use jstream which is on the ladder of l8 and the important thing here we're going to do is that we're going to use jstream so that you may have a normal user and an admin so that you can log in between the two parts so let's say you are making an application a website or an e-commerce whereby you need to have an admin going to inside and also having the normal user been directed to another player so we're going to use uh laravel and using jstring now this stream is an application or it's a framework that enables you to get started quickly in our website and so forth so now what we are going to do today um or where we are going to get started is already i have already installed the jet stream which is easy to install you just need to have uh to run this several commands for example if you do not have it installed this is just a simple way you can use to install it so what you need to do what you need to do here the first command would be would be just um this command laravel new that is laravel new that is the name of the project and then a dash dash jet so that you can install the jet stream and then once you click enter it should ask you the type of uh laravel that you need to have which which jstream stack do you prefer uh so jstream comes under two forms it comes under live wire or inertia uh for you to understand more is you just need to read that documentation because this tutorial is not about that and for example let's say uh inertia mostly we'll use the view and then livewire will be the other normal version of it so what you need to do here is that for you to get started well you may need to go under documentation of this stream and as well livewire or in azure so since i already have it installed i'll not install it so just cancel this but you can get started with it using uh any form way so now let's begin so the first thing we need to do since already have it installed is upside so you just need to run the particular command as outside and then once you finish run npm uh npm install and then pm round f so that you can combine and mix your laravel um css and so forth so that's how you get started with g stream um so once you have just stream installed the next thing we need to do now here is you just now need to get started now another thing before we start with this tutorial you need to know is that um i already changed this gesture now this stream comes with tailwind css and the telling css is that if you have a bit of knowledge about it i've already done a tutorial on it as well uh how to get started to tell you in the framework so in when you install the stream it comes with turbulent css but since i needed to use the bootstrap i need to convert it to bootstrap and so i'm using bootstrap but when you go for example to the login page to the login blood you can now see this is tailwind uh css framework this is how it is presented if you are not uh familiar with it but it still come it will still go with the bootstrap that i have already changed now there's a package that does that and for you to get started with you need to go to you need to go to this particular github repository and you'll get started with in other words you're able to change your tailwind css to bootstrap that is by installing the the just drop and the just drop is this one so if you install this one it will b it will install install all the dependencies that you need to use and then as well you can get started with it once you finish you just need to run this command swap the live wire and then finally you run npm install and npm run there so we are not going to do that since i've already done it to save time as i've said now one thing another thing you need to know is that i will uh copy uh some of the code in this uh tutorial because some of the code is also too lengthy and as well to save time so is to make this tutorial a bit smaller so so but i would like i will explain step by step so you just need to follow up with me and then you'll be good to go so now let's get started with this now as a as well i've said we are going to get started we are going to implement a laravel mod authentication whereby you are going to have a normal user and an admin so normal users are directed to their parts and their domains are directed to their pad you may be wanting to make such an application whereby you need to have admins directed to this part and no more user to this other part last step so let's get started so enough of the talking so let me get started now you need to have this installed as you have said and let's now start with with running the application so php addison so let's uh open this application so i'm opening it at 127 800. just the local server so now this is laravel registry so under laravel the stream is what happens so let's go to the login page uh this is what is the login page if you are new to jstream this is how the stream is it is kind of advanced from the earlier versions of laravel so another thing is let's look at the registration page so now you need to realize i've already converted this from to bootstrap so it is using bootstrap so some styling might have changed so now let's go to the login page and let me login so i've already registered a name so let me just login to this in in other words it registers and logs in he's taken off to the normal dashboard so now this is the normal dashboard or laravel j stream so what you need to know is that the normal user will be directed to this part and then this is what will be presented now if you get to implement this application no you're able now to put something different let's say it's a blog so the normal users will be directed to the part that you want them to go to and then let's just see some of the things with this stream so your stream also has the teams and all these things that you're not going to look at today and then it also has a profile whereby you're able to check your profile within uh jstream so this is just streamed it also has your name and the email and as well the good thing that comes with this stream is the two-factor authentication this one i will explain it in another tutorial so this is what your stream is all about but we are now looking at multiple authentication now since so now when you type here for example the admin will now be taken to the to the admin page whereby you're able to implement the admin but since it's not implemented this is what you're going to do so all right guys so let's get started so now the first thing we need to start is that let's go to the out the php now out the php as the guards and the guards is whereby we have the it defines for us the places whereby the when the user is signed in is about to be taken to so the first guard here we can see here we have the session and the users as well so here we only have now the user's session is in this place so what we're going to do in the out.php we're going to add an admin session as well so that the admin can also get logged in when he logs into a website so let's start from this part so the first part is the guides and this is where we are going to get started with now as i've said i'll copy some of the code so that we may just uh save time in this tutorial but i'll explain it as we continue so now let's get started so now the first thing we need to do here we need to add an admin um that so so we're going to add an admin session just like you can see uh from above so what you need to do here i'll just need to copy some of this instead of having to type all of it again and what we're going to do here we're going to change this to an admin so that we can have an admin session and as well so providers here is going to be the admins instead of now users so we are going to have admin there the next thing we are going to do here we are going to have the api now the api is just the same way as we had this particular so we are just doing similar thing under this so you're going to have the api there so the driver same token the providers now will be the admins [Music] and then the ash will be forced as well so now that is what is within the admins that is under the indication guards now the next one since we are now done with that so here we need to have um now let me just save this and let's just see what's going on so now the next thing we'll need to do is to edit the providers array so under the providers array you can see we have a model and the model is using now guys this thing is still the same thing so just have to copy and edit what you are doing what you are going to do here so the same thing we are going to do is just copy this and then edit it for our admins so you're going to change this to admins and as well now this one is going to be the the model is going to be the admin so that's going to be the admin class and as well now what you need to do [Music] is quite fine so let me just say this now the next one will be the passwords so under the password we are going also to change something so under the password you are going to change we are going to to edit also the passwords for the admin so that we can establish the password the admin signs win so we are also going to change this to admins providers that is providers is going to be the admins and so forth so now this is what happens within the authentication i think we are done with this thing and like so so uh open your understanding up to them so what we are changing here we are just it's quite easy we're just implementing we are adding the admin uh in ourout.php so let's go to the next thing now once you are done with this one the next thing we need to do we need to go to the routes so let's go to the routes so under the web we are going now to establish an admin so this admin we are going to establish we are going to make a new admin dot php file which is going to have the admin uh functionality the the parts so you're going to define the routes under the admin so in the routes going to make an admin.php and then within the admin uh within php the web.php to require the admin dot php this should be in quotes so this is what's happening there let's save that so now within the admin we are going to establish the path that we are going to use so as to establish the there's an error here let me just see so i think this should be under the so now let's go back to the admin.php so here we're going to establish the routes within the admin.php now the admin.php um let me just bring out the code just to save time because of the typing let me just paste this so guys um so what i'm doing here is that we have the route group our prefix admin function and here now we are establishing a login controller that's your login form now we are going to create a login controller in the under the admin so that this login controller will handle all the login the logout functionality within our website under the admin part so we have what we have done here we have created an admin.php whereby we are now establishing the route for our admin so um so the next thing now we need to do here we need to have unlogin a show login form which is showing our login then let me copy and paste this code here now here we are going to show the the particular login itself so here we are only going to have the login itself the last one we are going to have is the login in so this is login so this one we're going to change it to login that is admin login and then this one we are going to we are going to have a log out so we have by the admin can as well log out from its order session now this one is not going to be the same as this is going to be admin login.post whereby once it gets logged in this is what is going to happen so now we need to establish okay this one is also logout so this one is going to be and bing dot logout and then this is login so this one we are going to have it as logout as well so these are the main.log out and then this is admin. this controller at logout and then now this one since it is post we are going to have the route post so it's going to do the post for us so now here we are done so what we are doing here is that we are going to create a controller file under the controllers and then this file is going to have the login the show login form and then it's going to have the post where the login the admin it gets logged in and where the admin can as well log out from our website so here we need to have a closing so we need to have this brackets and also the uh the closing like that now since we are not done with this one we are still coming to it back again let me say this so there's an error here so let me just quickly settle this so we are still going to come back to this again so let me just but now you can understand what you are doing we're establishing an admin dot php which nice defining for us the routes now since we have already implemented this controller login controller here let's just go to the app and let me let's just make this particular login controller so this one should be done under the apps so under the app here we are going to go to the controllers so under the controllers here we are going to make so let me just go to just clear this so here we're going to make an admin folder now this admin folder is going to have the login controller which is going to handle the login or the login functionality of our website so now let's create um an admin folder so under here we are going to create an admin folder here now this admin folder is the one we're going to create under php so php artisan mac so page patterson make controller login controller now there's something we need to do here so the login controller we're going to make is under the admin so this particular so from here we'll need to have the we need to have this so all right guys so now this should be the correct form so admin uh slash login controller now this one once we hit it should make a login controller within the admin so so we have a login controller now this login controller is the one which is going to have uh up it's good it's going to implement the admin functionality within our website now i'll just copy some of the code here because i'm seeing the tutorial is taking much time so let me just copy some of the code here but i'm going to explain as we go along so guys this sum of the this is the starting chord that we're going so what we are doing here we are we are directing admins are being directed to the admin and as well we are having the function construct whereby is going to log out the admin or we're going to implement the logout functionality and then this one is the show login form which is going to show our login form as we go along so now this is what we are starting in with the login controller so now the next thing we need to do here we need to implement or we need to make a login play for our admin so let's just go to the next thing next thing we need to make is a login blade and our login blade is going to be made in the views so just quickly go to the views now under the views here we are going to make the we're going to make the login uh the login blade now the login blood is similarly to what we have within our app that is when we log out from here we do have a login upgrade sorry i think our server needs to be restarted again so we need to have a login plan so now the login blade is similar as this one you can see here yes so now this is the login blend that we are going to have so this is what you are going to make and what i'm planning is just to take this particular template and use it in our admin site but as well once you get this application what you can do you can change it and make it in whichever way you want so let's just go back again and let's just check um so as i've said what you're going to do here under views we're going to make an admin whereby the first thing will be uh sorry this should not be a file that should be a folder so you're going to make an admin folder now under the admin folder we are going to make another folder called out out which is going to be under the admin so now once we are done with this one what you need to do here we need to create um now we need to create the login blade so let me just kill this up server sorry so we are going to have this command now attach resources out uh the main out login blur dot so that we can create the login blade under this particular folder so what you're going to do here we're going to click enter so now here we already now have a login blade which is an empty page now what i'm going to do here i'm going to take the login plate for dj stream and just copy and paste it to okay and paste it to the new login blade that you have made for admin so that they can just use the same now what we need to do here is to make it different with the other one the other one is for the normal user we are now going to change this route and make it to the admin so this is going to be so this is going to be admin admin login the post so this is what is going to be so that the admin will now under the route as we said here it's going to establish for us the login route for us so it's going to take it to the admin so this is what happens within our admin page so now we are now done with that one so now let's go to the next thing so now the next thing we need to do here is add the we're going we're going back to the login controller and now here we're going to establish the login functionality so that the admins can get logged in whether the person is an admin or is not an admin so what you're going to do here below this function show login form just like we defined within the routes now we are going to implement this particular functionality which is the login so here i'm just going to paste the discord and explain it so that due to time so what i'm doing here let me just squeeze it to so what i'm doing here we are going to validate whether the person is with the email the password and then we're going to use the authentication card guard that we have we had made to establish the the email the password and direct direct the particular person to the dashboard whether he is or not in admin so this is what happens within the login functionality so now the next thing we're going to do since we have implemented the login the next one should be the logout functionality so i'm also pasting this code so this is going to be the the logout functionality i think should be at that pace so now what we're establishing here is that we are checking if the person is an admin okay the person is will be the admin was logged in so once you log out the admin will be logged out immediately so now that's what happens in the login controller now the last one should be so now the last one is already now so since we already have the login we have the show login form we have the login we have the logout and the and this should be now the last one now the next thing we need to do is that now remember we can have the domain a person is not an admin he's an admin or not or is a normal user so he needs to get redirected if he's logged in so the next thing we need to do here we need to go to the direct if the person is is not if the person is not an admin it should be redirected to their home page so under the redirect authenticated if authenticated.php handles that so we are going to establish this particular functionality here this functionality here so this functionality is whereby we are going to establish that if the person is authenticated then the the admin will now be taken to the dashboard so i'm just going to i'm just going to edit this particular code here whereby i'm just going to change it to mine and what i'm establishing here guys is that we need to check if the person is um if he's an admin so what happens here is that here we are checking using the switch case if the person is an admin is directed to admin if is not is directed to the home page if is an admin will be directed to the dashboard so this is what happens within this particular session here under redirective authenticated.php so this is what happens under this so let me just save this so now let's go to the handler which handles now if the person is not an admin he should not be taken to the login page whereby should uh sign whether is a normal user he should sign as a normal user and be redirected to his or her page so that is what should happen next the android.php is going to handle if the person is not an admin then it should be redirected to the login page now let's go to the analog.php remember i'm explaining these things step by step so that you may be able to understand and implement as well you'll have the code in github so that you can go and check um and confirm whether you need to where you need to change if you implement such an application so what we're going to do here i'm just going to update this code below here not that the unlock.php is under the exception now the exception will handle whether the particular person is not an admin he should be taken to the login page now let me just paste this code for to save time so what happens here since some of this code is um what you need to do here you just need to check if the person what does the is if the person is an admin you should be taken to the login page if the person is not an admin should be taken to the default which is there which is a login page for example that this person is not an admin and is trying to log in as an admin you'll be taken back as a normal user so this is what happens within the angular page so you just update this code in this manner so now lastly we need to check uh lastly now we need to go to the next thing we need to do is to update the admin.php now the admin.php as we said it is what we created in the login controller where we had the luxury login form the login and the logout functionality now when you go to the login controller which is here it is what we implemented the login the logout functionality and the show login form and then we also have this particular path which says protector redirect to so we are now redirecting if the person is an admin he is the director to be admin and that is our command line here so now let's go and update admin dot php now admin.php we are going to update it in terms of the authentication we're going to enable it to have the authentication uh the middleware authentication where the by the person can be update can be certified whether it's an admin now let me just paste this now what we are doing here we are going to have the route group middleware i would indicate if the person is an admin and then if is an admin we are going to return him to this view at the main.dashboard.index in other words what we're establishing here is that the person will be taken to the admin will be taken to the dashboard whereby is able now to view what is in the dashboard but for that to happen the route should establish a middleware which is going to authenticate if the person is an admin so let me just have that one saved so guys i hope you're understanding this it's just simple as this we are just establishing the admin dashboard so that means now if we are going to have another view return view admin dashboard we need to create a dashboard within an index dashboard within our view so let's just go to the view here now within the view here we are remember we already have an admin here so under this admin we need now to create um we now to create a dashboard and this dashboard is going to be our it's going to be a folder and then under the folder we're going to have a blade so under the admin here i'm going to create a dashboard so this dashboard is a folder now under this dashboard we are going to create the index dot blood so now that's what we have so we have an admin dashboard index so we are going to come back to this file later now this one presents what is in the admin dashboard which is now presented under the index dot php so now the next thing we need to do here we need to create the admin admins table so that we can have an admin table which defines for us what uh is in the admin for example the password and so forth when the admin gets logged in so now we need to do that under our tables so let me just clear this now the next thing we need to do here we need to have we need to run this command php tables create circuit admins table so this should be the this command should create for us the admins this one should be that underscore so i php attend migration make mac create admin table so that's what we're going to do uh there is an error here let me check again so this should be php at sun mac mic so php ads and mac migration create admin stable should be this and then once we eat this one should create for us let me just check this so guys i'm getting an error in the android.php now there's something we need not import as it says because class app exception authentication is not available so we need to import this class there's a class here i did not import so that's why it is unable to create for us the admin stable so let me just go to the annual so under the and la already i have a class here which i should import just below here so this is a use uh that is our authentication exception which is this one which is coming under this particular error so let me save and let's try again and check if the database will be created but they are remain stable so it's now successful so now we already have admins table so let's just locate that and be instable [Music] in the means table so it should be some so this is the table so now what i need what we need to do here i already have this table created so let me just paste it to save time so guys this is it so let me just paste this so i already have the the database created for this particular project so what i'm going to do what we are doing here is that we're establishing the admin table where we have an id a name email verify that password so this is just the normal way we have the any authentication like the users so what we are just implementing now for the admin so we are giving it an id name email as well like that so this is what happens here so what you can do here we can migrate this table so that php addison migrate so that you can migrate this one so this is migrated now let's go to the next thing now the next thing we need to do is that we need to make our model uh before that we need to go to the seeders now in the seeders we need to seed this particular table with a particular dummy data so that whenever we log in we already have a log d we already have some data we can work with as we log into our admin so guys you need to create under the seeders you need to create the just like we have the database see that.php you're going to create the adminstable.php so what you need to do here we just need to come to the cds and then just create another file here now this file is going to be the admins admin stable so this should be instable cedar dot php so now this is what we are going to do here so this one i'm already having the code so let me just uh paste this code here and let me just explain so what you have in here is that we're going to create a fake admin so we're just going to have admin admin at admin.com and then the password is going just to be created randomly within this project so this is what we are going to do so we are going to run this particular um in other words once we see this one the table is going to be seeded with these particular details under this uh create and it means that is the email the name and the email the id will be generated automatically so this is what happens here so that you can establish the admins table now that's since we are now we are now done with that one thing is already here now in the database dot cedar we need to call this class as well um that is under laravel um database handling so what we need here we need to call this particular class now i'm mark in this class call this admin stable. see that class so that it can see our class here so this one needs to be there so that we can call the admin database see that dot p we are already now doing is uh we need to have to establish the models now under the models we need to have the we need to locate the models and under the moulders we can just use the manual way so let me just locate the model so the model should be under the app okay so as well it's just like we have the user.php here whereby we have the for example we have the file label the name the email the password we're going to do similar thing to the admin so come here under the models and make an admin dot php this should be php so that now this one is going to have the similar structure now in the admins.php we are going to have this code now this code is going to establish for us the the name the email and the password under the authentication as well so it is going to link up with our database so that we are able to establish search so this is what is happening in the admin php that is admin.php now let me just save that one so now this is um so after that guys if there's any question you just need just write in the comment section below so i could have uh done a bit more of explanation in terms of typing the code and all that but due to time we just have to use this one but what i would like you to understand is how to implement a laravel multiple authentication using jstring so now where we are now the last thing we need to do since we are almost through with this to make this tutorial so now the next thing we need to do as we need to do to finish up with this project is that now let's let's just check that the application and see where we are so let me run php at sun command and let's see where we are in already now so let's just check in so now the let me just reload this page again and let's see where we are in terms of the since now we already created the the administable seeder let's just see our our table with this particular information that we have created in within our cedar so what we're going to do here is that let me just destroy this server and let me just clear this so what you are going to do here we are going to have our php artisan dbcd so that you can see that with this particular information that we have okay so now this is successful so now that is done now the next thing we need to do um okay there's something i'm i'm remembering we did not explain the dots env now the dot env uh i had already created a database here within the exam so i'm using them so there's already a database here when you check um named laravel 8 app and i believe you're not new to laravel so it's already under the exam because i'm using a php mysql so you need to take note of that so let's continue now the next thing we need to do is that since we have already dbc the database now we need to check where the application is working guys let's check where this application is let me just uh run it again hp artisan serve so now what happens here let's just check where we are so now this is the login for the normal user so the normal user gets logged in as well as we said now we need to check for the admin functionality and let's see where we are in the admin so what i'm going to do here is that i'm going to indicate the admin so that i may now be directed to the admin functionality page okay now there's an error here that's coming so class up exception array not found so this one is being located under the exception handler.php now let's go to this file and see this error so now let's locate the angler so this is this so this is uh so what happens here i forgot to [Music] import a particular array functionality here since i'm using guide array exception guide so this under this particular this is where the error is coming from that is under this renault found so what we need to do here we need to import this so i just need to import this particular class and let's see if the application is working well okay so login our controller does not exist now this error is common if some of you have encountered at such an error using uh laravel gesturing so what you need to do here we need to give a pad in laravel j stream another in other versions this would work but in laravel stream this one will not work because there is a we need to indicate the path and this now this is where the path comes from so what we need to do here we need to come to the admin dot php now at that depend.php it says it can't find this particular um controller so what you need to do here this controller login controller is located under the the app and then under the app it's located so this is the path so the pad is here so the pad is up [Music] and then we are going to have it in this way so app and then the next one is http and then the next one is uh the controllers so we having controller should be yes so controllers and then it's under the the folder admin the one we created again so now this is it so now this one should be applied to the rest of the so that it may find this particular controller which it says is not finding i think there's a mistake here yes let me just correct this so now this is it and then the last one should be this one okay so now this is what happens so we having a app http controllers admin so that it can locate this particular file so under jstream we need to have this implemented so let's see if the error will go away let me refresh so it says admin login controller so at the main authenticated users not found so let's just check this error so guys this uh we also forgot to use the authenticated users not found so we need to have it under the login controller so under let's go under the login controller now under the login controller we need to use we need to find the authenticated users and this is where it is this is where it is so under this one we need to use this particular class use illuminate out authenticate users since we are already using it under this particular place here so let's just save and check again so let me just so guys this error is coming because in just stream laravel 8 i need to install the laravel your url ui so what you need to do here is that after checking out this so we need to run this command so that we can install require the laravel ui so that this particular error will go away so you just need to implement this one in your application if you have any question just comment them in the section below and i'll be sure to follow up with you so let's just wait for this one as it installs now guys since the laravel ui is installed so the error has gone away now the next thing we need to do here is that i'm also having another error now this error is saying an expected end if expecting end of file so what we need to do here since now we are in the at the main other side and remember we replicated the login blood from the login blood of the normal user and we turned it to the 200 we replicated it for the admin so what we're going to do here is that we're going to go to the row we are going to go to the admin so we're going to go to the place where we created the admin should be somewhere here now under the admin we are going to create another file and now this file we're going to name it going to name it up led php so now this is not going to be uploaded with php now here i already have my code so to save time let me just so guys this is this is not the code so remember that your code will be in the github so you just go and experiment now what's happening here is that um just ignore the css and uh from the awesome and all that since i use this one to create a particular project that they created for a particular client so what happens here is that we are going to have the include okay instead of now include the partials.nb here since we do not have them so let me just take this one out for now they will not be useful so so what is happening here is that uh i'm going to implement this one this is the applet that is handling our login blend so what's happening here now we are going to heal the content now just ignore the rest of this what we're going to do here we are going to ignore we are going to implement this at the end content so now when this is implemented under the admin app.blade now this error will go away so that now we are able to login into the admin dashboard remember the routes for admin dashboard are here so you can just say admin.index and so forth so now let me just login is an admin so just let me just go in as an admin so now this one should take me you can see now the error has gone away since that app the blade is handling our is not in the content from the login led in the admin side so this is the admin login plan whereby we said we are routing it under the admin.login.post so what i need to do here remember we created the adami we seeded our database with the dummy so this should be the what we see there password was password so let me just copy this and paste here and change this to small and let's see if it will log us to the admin dashboard so you can see so our application is now successful so what we can do here we cannot log into the dashboard now on the dashboard remember there is nothing since we did not put anything here but let's say for example i put this particular markup [Music] just for demonstration purposes it should have something maybe a document or something like um let's put so let me just put a p tag and i'm like the lorem font and let me just close this [Music] so let's let's just try and see something so at least there should be a change or something now this is your dashboard and you can now create anything within the dashboard now remember so now let's go back and check if this is true let's login as the now what we need to do we need to there's a logout functionality to remember that we implemented in the now if we go ahead and put this particular admin we are able to log out in our application and since time is too much spent um since it will not log me in till okay so let me just now i can log here is the normal user whereby we remember the normal user put let me see if i'll be logged in okay now you can see now this then so we have now successfully implemented the laravel multiple authentication uses jet stream now what i would like you to go and do is that is you can go and check any admin panel that you may want to use for the dashboard for example at the valley admin is a very good dashboard that you can use to implement now for example in our application here we should have the logout and and um whereby you can log out is an admin and then here the sidebar you can have the head we can have the dashboard whereby we have the sidebar for any thing that you may keep there so this is what uh you may use within the admin so you can check out the valley at the main it is in the github so for so to save time in this tutorial this is where i'm going to reach so where i've copied and pasted most of the code you just have to forgive me because of the timing and to save time and to ensure at least you have understood so remember we started in the out remember we started in the out whereby we implemented the out and the out we changed the guards in other words we added the admin guides within the password array past providers array and so forth and the password and then what else we did we we went to the admin and uh implemented the routes whereby we kept this particular route within the admin dash within the admin and then we created a dashboard index which is now the one we have just seen and then what else did we do we went to the web web.php whereby we required the admin.php we also went to controller.php whereby we implemented the direct to the admin and then we implemented the show login and also the login itself and the logout functionality for admin as well we went to the login blog for the the normal user remember we copied and pasted it for the admin and we only changed this to be admin login.post under this particular route here so under this route which takes it to post so that's what we did and then what else did we do now the other thing we did was to make an admin um dashboard sorry we made an admin uh we made our routes yes we made an admin folder and then we implemented the out the login which we have just seen the dashboard index and then we also want to make our controllers i think so in other words in the exception controller we we added if the person is not an admin you'll be returned to the login page and then we went also to the exception in other words we went to the redirect if not as indicated in other words if the person is not an admin you'll be directed to the homepage so that's what we have done in this tutorial now if you have any question i will sure comment it um in the section below so just comment there and if you like this tutorial just subscribe share it with your friends and let's see you let me see in the next tutorial if you have not understood this tutorial well i'll do more refined of this tutorial in a near future so guys let's meet the next tutorial thank you for watching
Info
Channel: Web Dev Trainee
Views: 4,568
Rating: undefined out of 5
Keywords: laravel, jetstream, livewire, inertia, web development, tailwindcss, laravel 8, javascript, bootstrap
Id: Di993hgcs0M
Channel Id: undefined
Length: 57min 38sec (3458 seconds)
Published: Mon Apr 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.