SC001 - Laravel 8 Multi Auth based on Roles

  Рет қаралды 48,470

Sawa Stacks

Sawa Stacks

Күн бұрын

What Multiple auth system refers to? Well, as the name suggests, it is a terminology that refers to the process of login by multiple users based on roles in an application.
In general, Authentication is the security process, and it indicates acknowledging the genuine user with proper account details.
Here is the archetype of this tutorial, we will develop two users one is admin, and the other one is a regular user. Based on their roles, we will allow them to access in the app using middleware. Let us begin our work and start building our application.
This time learn Laravel 8 multi authentication tutorial. You will learn how to create multi auth system in Laravel using middleware.
Multiple auth system means multiple users can log in to one application according to roles and use multiple pages.
Multiple authentications are very important in the large application of Laravel projects. Authentication is the process of recognizing user and admin credentials.
Create a middleware for checking the user’s role in multiple authentications. It is an admin or normal user.
Source code:
github.com/saw...
For more videos:
- Integrate Admin Dashboard Template in project
• SC002 - Integrate Admi...

Пікірлер: 91
@techloading3217
@techloading3217 Жыл бұрын
Best vid on roles ever. really, all i see on youtube is that they use livewire and other auth models and templates . but this vid is the best. thanks for your efforts.
@sawastacks
@sawastacks Жыл бұрын
Thank you🙏
@agungmaulana2849
@agungmaulana2849 Жыл бұрын
Omg you are a good tutor, i was totally dont know how laravel works and after i watch ur video im feeling more confident for my next assignment haha Thank you Mr Manzi Love from Indonesia
@sawastacks
@sawastacks Жыл бұрын
Wooow!. Thank you so much🙏
@mustafadundarcelebi1974
@mustafadundarcelebi1974 3 жыл бұрын
Very simply as possible, and clearly explained tutorial, thanks
@sawastacks
@sawastacks 3 жыл бұрын
Glad it was helpful!
@mdal-amin9762
@mdal-amin9762 3 жыл бұрын
Finally I have finished my task ,, Love you so much sir that i can not explain ,, I will pray for you , so that you always try to learn for us
@sawastacks
@sawastacks 3 жыл бұрын
Wooow. Thank you so much
@mdal-amin9762
@mdal-amin9762 3 жыл бұрын
You are most welcome,,, sir,, your tutorial was much then better,, really apriciated,, ❤️❤️❤️❤️
@sawastacks
@sawastacks 3 жыл бұрын
@@mdal-amin9762 Thank you.
@dwabuluka
@dwabuluka Жыл бұрын
Thank you very much. Worked like magic
@sawastacks
@sawastacks Жыл бұрын
Thank you
@albertabraham99
@albertabraham99 2 жыл бұрын
Thank you, Sir
@mohammedfalke2818
@mohammedfalke2818 3 жыл бұрын
Million Billion Likes For You and we can't Thank you As you Should For This Awesome Great Work. Thank you Again And Again . My greetings
@sawastacks
@sawastacks 3 жыл бұрын
Ohhh! Thank you so much bro.
@Defaulttt
@Defaulttt 3 жыл бұрын
FINALLY! I LOVE YOU MAN! THANK YOU FOR EVERYTHING YOU DID!
@sawastacks
@sawastacks 3 жыл бұрын
thank you so much justin
@sawastacks
@sawastacks 3 жыл бұрын
thank you so much
@shahriarsharar8363
@shahriarsharar8363 3 жыл бұрын
Sir, Your videos are best on internet , hope you will make an ecommerce project!
@sawastacks
@sawastacks 3 жыл бұрын
I will try my best
@asimhameed3388
@asimhameed3388 Жыл бұрын
Awesome sir... Thanks.
@siddharthrathod7608
@siddharthrathod7608 3 жыл бұрын
Great Work sir, Thank You!
@haaanaaa1245
@haaanaaa1245 Жыл бұрын
I love this one !!! One of the best ones !!! thanks for this one :)
@sawastacks
@sawastacks Жыл бұрын
Happy to hear that! 🙏
@haaanaaa1245
@haaanaaa1245 Жыл бұрын
@@sawastacks 😍😍😍😍
@marventhor285
@marventhor285 3 жыл бұрын
so clear and knowledgeable sir thank you so much
@sawastacks
@sawastacks 3 жыл бұрын
thank you
@marventhor285
@marventhor285 3 жыл бұрын
@@sawastacks sir you have some adding and update and delete ?
@sawastacks
@sawastacks 3 жыл бұрын
@@marventhor285 next videos we will see, Create, Retrieve, Update and Delete. Thank you.
@mohamedalsayed7552
@mohamedalsayed7552 3 жыл бұрын
Ali is a program that makes this beautiful sound
@sawastacks
@sawastacks 3 жыл бұрын
@@mohamedalsayed7552 Yeah. Balabolka
@keshavkumar9636
@keshavkumar9636 3 жыл бұрын
Very awesome explaining 👌
@sawastacks
@sawastacks 3 жыл бұрын
Thank you
@abdulmujiburrohmanluthfi
@abdulmujiburrohmanluthfi 2 жыл бұрын
very nice. thank you very much
@sawastacks
@sawastacks 2 жыл бұрын
Thank you
@LOMBOist
@LOMBOist 3 жыл бұрын
Thanks a lot Bro! You won a new subscription to your channel
@sawastacks
@sawastacks 3 жыл бұрын
Thank you
@muhammadtoseef6719
@muhammadtoseef6719 3 жыл бұрын
Great Job..!!
@sawastacks
@sawastacks 3 жыл бұрын
Thank you.
@92kmusic
@92kmusic Жыл бұрын
supari bro
@kennethkipchumba2532
@kennethkipchumba2532 3 жыл бұрын
Much Appreciated.
@sawastacks
@sawastacks 3 жыл бұрын
Thank you so much
@sikandernawaz2838
@sikandernawaz2838 3 жыл бұрын
Amazing content bro , keep it up ,
@sawastacks
@sawastacks 3 жыл бұрын
Thank you, I appreciate!
@jackodhiambo5710
@jackodhiambo5710 3 жыл бұрын
Is there a way to change roles in db,without interacting with the db directly?
@rwandalive771
@rwandalive771 3 жыл бұрын
Cyakoze muranyemeje basaza,, thanks for tuto,, natwe twabikora... add more vids, congraturations @irebelibrary
@sawastacks
@sawastacks 3 жыл бұрын
Urakoze cyane bro. ewana ndi kugerageza gukora cyane nshyiraho ama video meza.
@Ali-es8ee
@Ali-es8ee 2 жыл бұрын
thank you
@braynakossou9636
@braynakossou9636 2 жыл бұрын
Hi 👋 Good Job. But I'm facing an issue. After Log in, when I'm on my dashboard, u can't access any other. It redirecting me automatically to dashboard.
@randzocampo
@randzocampo 3 жыл бұрын
Thank you!!!
@Yonas20102
@Yonas20102 2 жыл бұрын
I love you tutorials Thank you very much cold you please add in the login checkbox remember that no working by me.
@kamrulhasannahid110
@kamrulhasannahid110 2 жыл бұрын
If we are typing wrong password it doesnot redirect back to login. This code in the login controller is not working if (auth()->attempt(array('email' => $request->input('email'), 'password' => $request->input('password')))) { if (auth()->user()->role == 1) { return redirect()->route('adminDashboard')->with('success', 'Successfully logged In'); } elseif (auth()->user()->role == 2) { return redirect()->route('userDashboard')->with('success', 'Successfully logged In'); } else { return redirect()->route('login')->with('error', 'Incorrect Credentials'); } }
@kingchrisbreezy
@kingchrisbreezy 3 жыл бұрын
i miss this guy.
@AhsanHabib-vt2dq
@AhsanHabib-vt2dq 3 жыл бұрын
tnx bro
@Razvanh29
@Razvanh29 3 жыл бұрын
Great work! Is there a written tutorial and/or Github repo?
@sawastacks
@sawastacks 3 жыл бұрын
Soon, this will be on github
@shifa543
@shifa543 3 жыл бұрын
how to modify the dashboard (profile, settings) ? please help. the css files aren't loaded in the dashboard
@shahriarsharar8363
@shahriarsharar8363 3 жыл бұрын
sir, You made a video on seperate table (admin, doctor) multi auth... Can I use this process of role on those tables? would I have to be aware of anything or any change that time??
@sawastacks
@sawastacks 3 жыл бұрын
You mean multi guards authentication but (admin/doctor) table have roles?.
@shahriarsharar8363
@shahriarsharar8363 3 жыл бұрын
@@sawastacks yes sir, just on that tutorial I also want to add roles , like in admin table ,i want moderator , editor , super admin roles adding a field "role" in the table!
@sawastacks
@sawastacks 3 жыл бұрын
@@shahriarsharar8363 I will try
@syedsaad75
@syedsaad75 Жыл бұрын
@@sawastacks yes exactly
@sauravkarmakar1811
@sauravkarmakar1811 3 жыл бұрын
How to use ..user defined roles like Teacher and student,if role is teacher it will move to teacher dashboard and if role is student it will move to student dashboard?
@mohammadnazari9384
@mohammadnazari9384 3 жыл бұрын
Great job. why didn't you use the laravel-permission?
@eliast5485
@eliast5485 2 жыл бұрын
Error : routing[admin.dashboard] not defined (this is my error)(solution?)
@adityadwi369
@adityadwi369 3 жыл бұрын
Sir, can we change the boolean type data to int to auth based role? cause i already have the database and my type data for the role table is int not bolean. I try to follow your tutorial and when i check it out, it always return to login page and can't receive any data from my database. Sorry if my english is bad sir
@sawastacks
@sawastacks 3 жыл бұрын
Hi Aditya. Yes it will work perfectly.
@Saboor-Hamedi
@Saboor-Hamedi 3 жыл бұрын
Mine is not working, after logged out I can go back to the dashboard, why is that ?
@lokendrasinghpanwar3322
@lokendrasinghpanwar3322 2 жыл бұрын
How I fix illegal offset type error
@asimhameed3388
@asimhameed3388 Жыл бұрын
Sir make a video of comments section in laravel ajax based.
@manishdhungana331
@manishdhungana331 3 жыл бұрын
can you teach a method directly going to admin when a admin logins , same for the user without updating the role id in databse
@sawastacks
@sawastacks 3 жыл бұрын
After registration?
@manishdhungana331
@manishdhungana331 3 жыл бұрын
Another method of admin and user registration without doing anything in role without updating in mysql
@sawastacks
@sawastacks 3 жыл бұрын
@@manishdhungana331 You can achieve this by using Multi Guards Authentication.Check here kzbin.info/www/bejne/gXOkY2WmiMqim5Y
@ashique12009
@ashique12009 2 жыл бұрын
Route middleware group is not working. Where I'm logged in as admin then if I click browser back button then it redirects me to login screen. ============ Route::middleware(['middleware' => 'preventBackHistory'])->group(function(){ Auth::routes(); }); ============ Anyway thanks. 👍
@markjenkins6785
@markjenkins6785 2 жыл бұрын
Make sure that RedirectIfAuthenticated.php is correct.
@markjenkins6785
@markjenkins6785 2 жыл бұрын
Here is the correc code: if(Auth::guard($guard)->check() && Auth::user()->role == 1){ return redirect()->route('admin.dashboard'); } elseif(Auth::guard($guard)->check() && Auth::user()->role == 2){ return redirect()->route('user.dashboard'); }
@justapasserby445
@justapasserby445 3 жыл бұрын
Can I know how to put CRUD into it?....
@jannusdomingo5681
@jannusdomingo5681 3 жыл бұрын
Man I need you, can you explain where the Auth::user() comes from? Is it automatically select the users table or what? Is it built in with laravel or it's because of make:auth command? Thanks man
@sawastacks
@sawastacks 3 жыл бұрын
Hi Jannus Domingo. This comes after installing auth ui: laravel.com/docs/8.x/authentication#retrieving-the-authenticated-user
@jannusdomingo5681
@jannusdomingo5681 3 жыл бұрын
@@sawastacks but what is Auth::user() really does? Is it selecting the users table? Thanks for replying man
@rootnepal8793
@rootnepal8793 3 жыл бұрын
@@jannusdomingo5681 yes it does select the user table that you create after intalling larevel auth:ui
@jannusdomingo5681
@jannusdomingo5681 3 жыл бұрын
@@rootnepal8793 thanks for the reply but Auth::user() doesn't need the auth command. I figured it out. Thanks man
@kingmega8730
@kingmega8730 3 жыл бұрын
Thx
@davebudah
@davebudah 3 жыл бұрын
Can I delete the home view as well as the HomeController, and create them without authentication, because I don't want it to be part of the views that need authentication. I hope its not a silly question, lol. Other than that, thank you for a wonderful tutorial.
@sawastacks
@sawastacks 3 жыл бұрын
Yes you can.
@davebudah
@davebudah 3 жыл бұрын
@@sawastacks Thank you very much.
3 жыл бұрын
Let s go custom login with roles
@webgenerator5470
@webgenerator5470 3 жыл бұрын
where is role_user?
@khalidbinwalid8915
@khalidbinwalid8915 3 жыл бұрын
Source code please..
@sawastacks
@sawastacks 3 жыл бұрын
Source code: github.com/Mbere250/Laravel-8-multi-auth-based-on-Roles-with-examples
SC002 - Integrate Admin Dashboard Template on Laravel Project
10:43
Jetstream/Fortify Multi-Auth: Roles, Permissions and Guards
19:00
Laravel Daily
Рет қаралды 100 М.
Oh No! My Doll Fell In The Dirt🤧💩
00:17
ToolTastic
Рет қаралды 13 МЛН
Apple peeling hack
00:37
_vector_
Рет қаралды 62 МЛН
女孩妒忌小丑女? #小丑#shorts
00:34
好人小丑
Рет қаралды 100 МЛН
Write Laravel, not PHP (feat. Aaron Francis) | 029
58:45
Backend Banter
Рет қаралды 16 М.
Log in & Registration in Laravel 8.x : Laravel/ui - Bootstrap
10:47
Takneeki Code
Рет қаралды 32 М.
Laravel: Create Public API with Cache and Rate Limits
12:18
Laravel Daily
Рет қаралды 45 М.
Laravel Filament Roles and Permissions Full Tutorial
1:50:41
Tony Xhepa
Рет қаралды 34 М.
Laravel Jetstream: Add CRUD with User Roles
16:51
Laravel Daily
Рет қаралды 153 М.
Oh No! My Doll Fell In The Dirt🤧💩
00:17
ToolTastic
Рет қаралды 13 МЛН