18 Authentication Features - FilamentPHP V3 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends Tony here so in the previous video we worked with multiple panels and we are inside the app we are not logged in and we have redirected to the login page also if I go to the admin panel we are redirect to the login page but here we have admin slash login and if a navigator app we redirect app slash login now if I want to register a new user we don't have the register page and that's what I'm going to do in this video I want to create also the register page and I'm going to remove the admin login page so I'm going to have until the login page inside the app and also the app panel is going to be the default one so let us start and work with that I'm going to open first the app panel provider and then let's open the admin panel provider in here okay now the admin panel provider is a default one so I'm going to remove this also I want to remove the login inside the admin I would want to have only one login page inside this panel and this one is going to be also a default one and I'm going to remove also from the admin the house middleware okay let's save here and now inside the app I'm going to chain the registration method if I change that and Save let's come here and take a look to the form here if I refresh now we have a new link sign up for a new account and if I click we navigate to the register page with the register for name email password and password confirmation if I navigated the admin users yeah we have this error because I removed the out middleware okay I'm going to leave it for now this one and let's go and create a new user I have made a Artisan migrate fresh so we have only the user created from the database Seether now let's create a new one let's say test user with a test at test.com and the password and here password sign up and now let's register a new theme let's say test theme and testing sign up okay we are directed to the app very good here's the theme we can create a new theme or theme profile here now what I want if I want to navigate the admin instead of go and change the url I want to have a link here on the users menu here we have the link to sign out I want also the link to navigator admin so for that let's go and I'm going to chain right here new method which is going to be the user menu items and you accept an array so let's add an array here and let's create a new item so we can say menu item and call the static make method and here I'm going to give it a label so let's say in label here and I'm going to say admin also we can add uh icon I'm going to paste this icon here and now we need also to add the URL so let's say URL and for the URL I'm going to say slash admin okay if I save this and let's see on the browser we are inside the app panel refresh if I click here we have the admin and if I click we navigate to the admin dashboard now the same I want to have the link to navigate the app for that I'm going to do the same thing also inside the admin panel so let's copy that and let's paste it right here we need to import the user the menu items and here we say make now with a Chance labeled from admin to B dashboard okay I'm going to leave the hello icon the same and just change the url to be slash app if I save this come here and refresh we are inside the admin panel and yeah we have dashboard here let's click we navigate the dashboard good now if I click here and as you can see here this is now clickable if you want you can also change a new method so here we have a registration and with the chain the profiles method and if I click here and refresh now as you can see the profile is a link if I click we navigate The Hub profile and we can change the name the email in also added a new password also you can customize this page and I have created a video about that but if you wanted encoded filament documentation and read more inside the panel Builder users section okay one more thing here in this video is I want to show this admin link only if the user is admin right now this user is a test user so I want to hide from this one how to do that let's close now the admin panel provider and here when you have this menu make menu item make we can chain a new method here and say hidden or visible which except Boolean closer and I'm going to add a fan here A Closer we can return Boolean and I'm going to say if the authenticated user is admin is admin now we don't have this method so we are going to create this one let's save and let's open the user model and let's create a new method here so just public function is admin just return Boolean and I'm going to say return if this email is sweeper report admin at example.com okay if I save this come here and refresh click we don't see that admin link let's sign out and let's sign in with admin example.com passing the password sign in create a new theme so let's say laravel team and also laravel slug okay now we are as admin and you can see we have the admin link and we can navigate here okay friends that's it all about this video I hope you enjoy and don't forget to subscribe to my channel like the video share with your friends and see you in the next one all the best
Info
Channel: Code With Tony
Views: 8,376
Rating: undefined out of 5
Keywords: laravel, vuejs, livewire, laravel 8, laravel 9, laravel crud, laravel 8 tutorial, laravel 9 tutorial, filamentPHP v3, filamentPHP, laravel 10, filament tutorial, Laravel filament, laravel filament php, laravel filamentPHP tutorial, Filament v3 tutorial, master Laravel filamentPHP, learn, learn Laravel Filament admin panel, laravel admin panel, Laravel models and migrations, laravel multi-tenancy
Id: weL24ENTZ3w
Channel Id: undefined
Length: 8min 9sec (489 seconds)
Published: Tue Sep 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.