Тёмный
No video :(

Laravel: Separate Admin/User Areas - Designs, Routes, Permissions 

Laravel Daily
Подписаться 143 тыс.
Просмотров 78 тыс.
50% 1

How do you separate the designs and the routes for administrator users and "front" users of your system?
In this video, we will have an example that covers 4 things:
- Visual design/Blade
- Route groups and URL prefixes
- Redirect after login to their own area
- Middleware/permissions: protect the admin area from access by simple users
Repo: github.com/Lar...
- - - - -
Try our Laravel QuickAdminPanel: bit.ly/quickad...
Enroll in my Laravel courses: laraveldaily.t...

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 84   
@stephenamell8325
@stephenamell8325 4 года назад
The most underrated channel. Surprised by the quality of content.
@milenkostadinov8702
@milenkostadinov8702 2 года назад
Hello Povilas. Have I mentioned that every time when I get my head cracking on something silly but needed for a project, I can ALLWAYS rely on your Laravel Daily channel to achieve the simplest and most secure approach for a fully working profile. I can't thank you enough for that and I can't understand why your channel is so UNDERRATED when you should have millions of people profiting from the skills and knowledge you share with such a passion and ease!
@LaravelDaily
@LaravelDaily 2 года назад
Thanks for the kind words, glad to help!
@audreyyy4600
@audreyyy4600 2 года назад
@@LaravelDaily Please make laravel 9 version of this soonest
@Piazzi_
@Piazzi_ 4 года назад
You can also create gates and then apply them in your routes: Gate::define('Admin', function ($user) { return $user->category == "admin"; }); Route::get('/', HomeController@index)->middleware('can:Admin'); A simplier way to do it. Great Video!
@hananes4621
@hananes4621 3 года назад
Can you help me for my project ? Pleeeeeas
@andersoncdz1
@andersoncdz1 Год назад
I like this approach. In the framework I'm using I extended the default login driver and added a column type in user table and added a method to login driver that checkes the user type, like that: Auth::isClient(); It has worked well for me. I will test laravel soon, i've watched some videos about and it seems very productive to me.
@isslemcookie5795
@isslemcookie5795 4 года назад
U make the best direct understandable easy videos
@holacuba2001
@holacuba2001 4 года назад
As a beginner I understood 100%. Thanks
@mugen31337
@mugen31337 4 года назад
For Spatie Laravel Permission your can use this: if (auth()->user()->hasAnyRole(['super-admin', 'admin'])) { .... } or hasRole('admin')
@kasiryenicholas1569
@kasiryenicholas1569 3 года назад
on which route or controller or view
@chidieberechukwudi9077
@chidieberechukwudi9077 2 года назад
Thanks
@KingstevenNOS
@KingstevenNOS 4 года назад
Thank you😭😭😭 i needed this for a project
@chhinhsovath
@chhinhsovath 3 года назад
Great tutorial with fully function repo. Thank you so much brother
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 года назад
You are awesoooome!!! I was getting stuck creating a Real Estate projects because I'm using Jetstream for Admin but I was lost when I was to create the User's area
@codelaravel
@codelaravel 3 года назад
appreciating your videos. I want to see laravel testing video series, Unit ,feature and acceptance testing. Please make video on that also.
@gfetea
@gfetea 4 года назад
Great videos Povilas, I don't miss any :)...Would be very interesting to see a video (even a course) about permissions/roles with separate tables in DB. A table for regular users and a table only for admins.
@PovilasKorop
@PovilasKorop 4 года назад
Thanks for your kind words! To be honest, I would never personally recommend to have two separate tables, it's a pain to maintain then, you then need to have two separate auth systems. Anyone who logs into the system is a USER, so they need to use the same Laravel Auth and login mechanism. And then their roles/permissions should be defined in other tables or packages. My overall take on Roles/Permissions is in this course: laraveldaily.teachable.com/p/practical-roles-and-permissions-in-laravel
@sandeepdcte
@sandeepdcte 3 года назад
That's great..I am very much impressed with your skills... Incredible...
@holacuba2001
@holacuba2001 3 года назад
Important thing very well explained. I don't know what is better: your Laravel sklills or your communication skills?
@fastpanda
@fastpanda 4 года назад
Nice and to the point!
@DedexYoutube
@DedexYoutube 2 года назад
Thank you, this is exactly what i wanted to do.
@shashikanuwan
@shashikanuwan 3 года назад
How can redirect to a different page using thelaravel breez and Spatie permission package?..(admin,user)
@lasithadulshan7357
@lasithadulshan7357 10 месяцев назад
Thank you sir !
@dgloria
@dgloria 4 года назад
Hi, could you please increase the font size in your videos? I'm on 1080 and it's still blurry. I know my eyes aren't too good, I don't really want to overstrain them. Thank you. + what is app http kernel?
@pratibimbakhadka487
@pratibimbakhadka487 4 года назад
I would prefer pivot and belongs to many. It makes code a lot cleaner and it does not require complex logic to perform multiple role based auth.
@1mr4n4li
@1mr4n4li 4 года назад
In quickadminpanel how i do is i create permission access_adminpanel and on login redirect page if i see if role has admin panel access it redirects to admin panel. I do it because in future i may need user or other roles to access some part of admin panel. through quickadminpanel i have to just assign through roles and permissions rather than editing redirecto function.
@muhammadaftab9252
@muhammadaftab9252 Год назад
Hello thank you so much for posting and helping us with your extra ordinary knowledge. I would like to make a request please. Can you make a video or tutorial about the strategy for multiple user roles which has access to their child and grand child data please?
@LaravelDaily
@LaravelDaily Год назад
Can you rephrase with a specific example of what is "data" and what are "child" and "grand child", any real-life practical example? Then I would think if it's worth a separate tutorial.
@muhammadaftab9252
@muhammadaftab9252 Год назад
Like a CRM user tree.
@LaravelDaily
@LaravelDaily Год назад
I haven't worked with such projects, need more details
@muhammadaftab9252
@muhammadaftab9252 Год назад
@@LaravelDaily I will share the proper details today as this method is being used in ERP and CRM softwares and web apps also in multi vendor system, thank you.
@muhammadaftab9252
@muhammadaftab9252 Год назад
Please check your email, I have sent the details.
@JamesAutoDude
@JamesAutoDude Год назад
Is this bad practice though? Since you're forcing it to a specific role? Like what if I add "managers", I would have to recode and add everything that I added for admin and user right?
@pipe201196
@pipe201196 4 года назад
Very good master, i like it
@NirajPal
@NirajPal 2 года назад
There is a issue how to solve this if you have login with user account, and you go see home URL (project3.test) gives you 403 with project3.test/admin route I think It should be redirect with project3.test/user if the user logined in. But in case of admin it works well!
@derkjna
@derkjna 4 года назад
Could you make a video about the repository design pattern in Laravel? Have been reading quite a bit about it but every writer has their own approach. With every article there are many comments about what is wrong and good about the provided examples. However there doesn't seem to be a general idea about what a good repository design pattern looks like.
@PovilasKorop
@PovilasKorop 4 года назад
I've talked about Repositories in my course: "How to Structure Laravel Project" - I've just made this lesson public for free, so you can watch here - laraveldaily.teachable.com/courses/how-to-structure-laravel-project/lectures/8760335 - and maybe enroll in full course.
@chibanemourad2754
@chibanemourad2754 3 года назад
thank you very helpful ,but i have some problem haw can i prevent admin to access '/user' link ?
@danilolima3224
@danilolima3224 2 года назад
Thank you very much, man!!!!!!!!!!1
@NGatNan
@NGatNan 3 года назад
can we use more than one middleware in backpack for laravel, if yes then can you make a video/tutorial for this one? or if you already made the tutorial, can you paste the url here. I need it. thank you sir
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 года назад
So I shouldn't use Make:Auth for User area after I created Jetstream auth for Admins right?
@ervanrhermawan2380
@ervanrhermawan2380 2 года назад
is it possible to do this if there are multiple user types?
@syamfadlan
@syamfadlan Год назад
thank u soo muchh
@messismo10
@messismo10 3 года назад
4:20 i can't find the difference between using redirectPath and authenticate methods in LoginController
@sandeepdcte
@sandeepdcte 3 года назад
Could you pls suggest what is the best way to manage user login/register/role/permissions?
@LaravelDaily
@LaravelDaily 3 года назад
I have this video about it: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kZOgH3-0Bko.html
@nabildeveloper9193
@nabildeveloper9193 3 года назад
i have run this project how do i get register page in this project for register new admin
@amitdev1485
@amitdev1485 3 года назад
How to customize user menu.. We have admin menus at layouts.menu but what about user
@adnanjojo
@adnanjojo 3 года назад
how can I do it Fortify? i have middleware, layouts and routes etc but now I do not have Auth Login controller. So where should I handle the redirects as per user type? Waiting for your guidenes. Thanks
@adnanjojo
@adnanjojo 3 года назад
Well i found a way by creating a responses directory and create LoginResponse class with toResponse method in it. Please share your thoughts on this approach. thanks
@VimKanzo
@VimKanzo 3 года назад
Great tutorial. Was wondering if u could do a video on having a sub account tied to the main account where they can share resources. E.g if u have a system where the main user account has some sort of points or let's say money in their account, they can create a sub account which they can allow the sub accounts to spend their money, or allow a specific portion of the money to them and once its finish they can contact certain actions because they don't have money. Also the sub user or account should be able to view its own report. Maybe user can toggle between main accounts and sub accounts. Thank you
@subhanassiddik6320
@subhanassiddik6320 3 года назад
thank you
@mumairvlogs8730
@mumairvlogs8730 Год назад
what is login credentials
@SaywanGanji
@SaywanGanji 3 года назад
That's sound great
@homeuser3108
@homeuser3108 3 года назад
Is it ok to have one shared public folder for site and admin areas?
@LaravelDaily
@LaravelDaily 3 года назад
Yes
@baadrqaaba9529
@baadrqaaba9529 3 года назад
The question is how to separate entirely the admin section in your laravel app, if the user tape for exemple /admin/dashboard this route should be hidden , i think the solution is to make sub domains .
@ianbjs
@ianbjs 3 года назад
can I use this for laravel 8?
@arturodelosangeles
@arturodelosangeles 3 года назад
What if I have two different tables? for example users for admins , and students table for student type of user?
@jasperbesinga
@jasperbesinga 2 года назад
this is my problem since my other type of user have a another relationship with another table so having a separate table aside from admin would be great
@bfgproduction136
@bfgproduction136 6 месяцев назад
Here I suggest choosing an admin panel for your Laravel project: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UCIlU1DAYus.html
@magic1708
@magic1708 4 года назад
Is it possible to enter Controller in Http/Controller with route::group namespace club? I use few controllers with simalarie methods for user and club. Thank you
@PovilasKorop
@PovilasKorop 4 года назад
Sorry I didn't understand the question. All Controllers of Laravel are in Http/Controllers. I guess the only answer to your question is "try and see if it works".
@magic1708
@magic1708 4 года назад
Povilas Korop i have the Group Namespace set of Club. Laravel errors tells me, when i try to call the method in my controller, that there is no controller in http/controller/club. My for example „shootingbook“ controllers is under http/controller. As anwork around i have add my routes for auth:club not in the „group club“ routes function
@PovilasKorop
@PovilasKorop 4 года назад
@@magic1708 Without debugging the full project, I can't really answer what is the best solution. If you found a workaround, then great.
@salimbaraza904
@salimbaraza904 3 года назад
Respect...
@TheMessixaviniesta
@TheMessixaviniesta 4 года назад
I use a similar approach, but I place my admin routes y a separate admin.php file and I use web.php for regular users.
@kenjohnsiosan9707
@kenjohnsiosan9707 3 года назад
how?
@TheMessixaviniesta
@TheMessixaviniesta 3 года назад
@@kenjohnsiosan9707 In RouteServiceProvider, you'll see how they include web.php
@kenjohnsiosan9707
@kenjohnsiosan9707 3 года назад
@@TheMessixaviniesta thank you sir
@SajidAli-zb3it
@SajidAli-zb3it 3 года назад
On same widow without logout any
@stephenkatuli2991
@stephenkatuli2991 2 года назад
im having touble acessing the register page
@Satheeshkumar-dv1uu
@Satheeshkumar-dv1uu 4 года назад
I am not big fan of packages. So I just create myself with custom guard
@ajithlal1688
@ajithlal1688 4 года назад
Im using permission to prevent the users with different roles
@stratboy2
@stratboy2 9 месяцев назад
these videos are old, you maybe should refresh them with laravel 10
@LaravelDaily
@LaravelDaily 9 месяцев назад
I will probably wait until Laravel 11 cause they promise major skeleton changes there, don't want to reshoot again.
Далее
How This New Battery is Changing the Game
12:07
Просмотров 213 тыс.
DHH discusses SQLite (and Stoicism)
54:00
Просмотров 59 тыс.
From Blank to Blog With Laravel in 10 Minutes
12:21
Просмотров 12 тыс.
Laravel: Change Two Symbols to Boost Eloquent Speed
6:34
Laravel Migrations: 12 Useful Tips in 12 Minutes
12:06
The Tools I Use to Build Products in Laravel
19:00
Просмотров 24 тыс.