Multiple Authentication in Laravel 5.4 Natively! (Admins + Users) - Part 1

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 625

  • @erenergul1772
    @erenergul1772 7 лет назад +1

    We are waiting ecommerce video from you. Lots of people start ecommerce video and then they stop after few videos. There is a huge potential about ecommerce system. Btw This series looks amazing.. If you consider ecommerce system for future project. It will be great! thanks

  • @AvellarRecords
    @AvellarRecords 6 лет назад +19

    Dude, even my dog ​​understood your video! Thank you for your teaching.

  • @kabirabiodun5617
    @kabirabiodun5617 6 лет назад

    Your tutorial is very amazing, very explanatory

  • @CarpeDiemHacker
    @CarpeDiemHacker 7 лет назад

    men this is great, laravel is so perfect and you teach very good :)

  • @DaveClarkFive
    @DaveClarkFive 6 лет назад

    Excellent tutorial!

  • @muhammadsaeedparacha4160
    @muhammadsaeedparacha4160 7 лет назад

    You really make it easy

  • @meltonsy
    @meltonsy 7 лет назад

    Great, I assume this is a preparation for the CMS series?

  • @hardlifengirande4964
    @hardlifengirande4964 6 лет назад

    Thank you sir for this tutorials, l had understood multiple authentication well, my question is how do l use the same login form to direct to mutiple users dashbords. thanks following you in Zimbabwe

  • @alaamokhallalati8978
    @alaamokhallalati8978 6 лет назад

    Thank you very much, you are the best

  • @reisnobre
    @reisnobre 7 лет назад

    I just started to watch this video, would something like that work with Laravel/Passport?

  • @WoraprushPokhaw
    @WoraprushPokhaw 5 лет назад +12

    I signed in to thank you specifically. You are the part that makes me graduate.I wish you success in everything.Thank You,so luck

  •  7 лет назад +78

    You are the best my man! Your videos they will be 5-10 min but you explain everything like a teacher and I learded lots of think from you.
    Best regards from Turkey 👍

    • @TamilTipsTVLanguageSchool
      @TamilTipsTVLanguageSchool 7 лет назад +1

      mee too

    • @asadiftikhar2252
      @asadiftikhar2252 6 лет назад

      Bro!! this is fake channel making money by fake channel this is udemy course video downloaded and then make 1 and making money

    • @martinsonuoha
      @martinsonuoha 6 лет назад

      Don't be stupid, if it were an Udemy Course he wouldn't say "I didn't know how to do it"

  • @syedusamakazmi4386
    @syedusamakazmi4386 4 года назад +5

    Give this guy a medal, what an explanation!!! Laravel docs just make me wanna puke but this is so simple God Bless You buddy don't ever let anything stop you.

  • @fahadnasir9450
    @fahadnasir9450 3 года назад +2

    Still helpful in 2021 with Laravel 8.x :D

  • @numaitutururu5155
    @numaitutururu5155 7 лет назад +72

    I love your videos Elon, I don't know how you manage to get time to make laravel tutorials while building tesla

  • @techjots7790
    @techjots7790 5 лет назад +3

    I'm willing to bet that you have the best tutorials on ............any platform really, not just RUclips. Your in-depth approach has helped me understand so much, Thank you man, you're a Super Hero

  • @freddie871
    @freddie871 7 лет назад +12

    Wonderful video - if you joined Laracasts, I would consider getting a subscription. I love Jeffrey, but you are my go-to for Laravel stuff. Great content, and your delivery is fantastic. Thanks for being attentive to your viewers' requests, you're an awesome dude.

  • @alexteie
    @alexteie 5 лет назад +2

    Well things are changed in laravel 5.8
    Declaration of App\Exceptions\Handler::unauthenticated($request, App\Exceptions\AuthenticationException $exception) should be compatible with Illuminate\Foundation\Exceptions\Handler::unauthenticated($request, Illuminate\Auth\AuthenticationException $exception)

    • @hashaamzahid3319
      @hashaamzahid3319 5 лет назад

      hello what change need to update to 5.8 thanks

  • @mcfly1986
    @mcfly1986 7 лет назад +2

    Thank you very much for the way you teach us. I do not know if you're a teacher at
    "real life", but of course you have the capabilities to be without doubt...Congrats from Spain!

  • @hashaamzahid3319
    @hashaamzahid3319 5 лет назад +4

    hello what change need to upgrade to 5.8 thanks

    • @love41412
      @love41412 5 лет назад

      i followed the video the same way as he showed with 5.8..and at this point i didnt have face any problem

  • @jacklindcosta6740
    @jacklindcosta6740 3 года назад +1

    Excellent! Also work with laravel 6

  • @TamilTipsTVHealth
    @TamilTipsTVHealth 7 лет назад +1

    Hi Brother, I have a customer who has 4 shops to manage his inventory system what is your best suggestion for me. it is better to have a company_id in each table or go for multi database tenanti?

    • @Nulimitz
      @Nulimitz 6 лет назад

      I would either use a company_id or location_id and a seperate table for company/location. The for the location model have a function public parts() { return $this->hasMany(Parts::class) } and then in the parts do a public function location { return $this->belongsTo(Location::class) } you can lookup all parts parts::all or parts::where('location_id', location_id)

  • @florianwiech1759
    @florianwiech1759 7 лет назад +3

    I really like that you are doing more advanced tutorials!
    your tutorials are so good! :)

  • @davidespigolon8170
    @davidespigolon8170 3 года назад +1

    The same tutorial with laravel 8?

  • @chrismanuel8993
    @chrismanuel8993 5 лет назад +4

    still helpful in 2019!

  • @CreepToeJoe
    @CreepToeJoe 5 лет назад +1

    This is probably the most comprehensive playlist on multiple user authentication in Laravel using the best practices in web development! Thank you for making it happen!

  • @ameetshrestha6424
    @ameetshrestha6424 5 лет назад +1

    Hey there!! Loved your videos and it really is helpful. Thanks for you time and effort. However, I want to ask you if this is applicable for Laravel 5.8??

  • @amazingrajeev
    @amazingrajeev 5 лет назад +1

    Hello sir, It's very good tutorial. I am looking for update of this tutorial for laravel 5.7. Got few issues while trying this tutorial on laravel 5.7

  • @IDStack
    @IDStack 7 лет назад

    Hi Alex, i haver some problem here.
    How to implement AuthServiceProvider for this admin guard ?
    so, I just wanna make role in admin tables, and in the AuthServiceProvider will add some gate define like this:
    Gate::define('admin-access', function ($admin) {
    return $admin->role == 'admin';
    });
    Gate::define('manager-access', function ($admin) {
    return $admin->role == 'manager';
    });
    Gate::define('supervisor-access', function ($admin) {
    return $admin->role == 'supervisor';
    });
    And I create a middleware with this function:
    public function handle($request, Closure $next, $role)
    {
    if (Auth::guard('admin')->can($role, '-access')) {
    return $next($request);
    }
    return response('Unauthorized', 401);
    }
    How can I use this roles with middleware like. role:admin or role:supervisor?

  • @YasserMoussa
    @YasserMoussa 7 лет назад +3

    Please help me i followed every step of your tutorial but at 27:00 i faced an error Auth guard [admin] is not defined take a look at this post
    stackoverflow.com/questions/43642816/auth-guard-admin-is-not-defined

    • @comtronicssystem1271
      @comtronicssystem1271 7 лет назад

      check your auth.php...in my case i edit that file but forget to save

    • @holzbein2k
      @holzbein2k 6 лет назад

      clear config cache

  • @silkproduction
    @silkproduction 5 лет назад +1

    why can't we extending User class for Admin? also why we need add new table for admin instead adding new column like is_admin? thank you!

    • @CODINGISEASY
      @CODINGISEASY 5 лет назад

      see my video on roles for another way of doing it

  • @OussamaAissaoui-k8g
    @OussamaAissaoui-k8g 6 лет назад

    there is problem {Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "syntax error, unexpected ''guards'' (T_CONSTANT_ENCAPSED_STRING), expecting ']'"Stacktrace:
    #0 Symfony\Component\Debug\Exception\FatalThrowableError in C:\xampp\htdocs\blog3\config\auth.php:39
    help me please

  • @the_egyptian_smough
    @the_egyptian_smough 7 лет назад +2

    Hi, thanks for the tutorials
    I have a question though
    Isn't it better to have one table for User which have all the common columns of users and have a column of (user_type =enum('admin' , 'customer' , 'company' ) etc... , and then have a foreign key for each table (user_id) which will point to the id in user id
    and if you have lots of different fields for each user type , you could use table for each with those different fields ?
    i would have put them in one Table and call it a day with putting all the different fields as nullable , but at the end I would need a different underlying business logic for my different type of users , so I would build a Model and a Controller for each one , so that's why I made a table also for each user type , with fields different from each other user (and I use foreign key user_id)
    Q1 : Is this method better and more readable?
    Q2: If we are using this method , would we need to have more than guard ?
    Thank you again and best Regards from Egypt :)

    • @adelabuelezz946
      @adelabuelezz946 7 лет назад

      i use this method but in current company i work on it i need video way this amazing to know more than a way to solve your problem ...

  • @oussamaseifeddinedjilah6032
    @oussamaseifeddinedjilah6032 7 лет назад +3

    You're the best, you're tutorials are saving my life :D i really do enjoy, great explanations keep on ^^

  • @japetsaberon5061
    @japetsaberon5061 6 лет назад

    2018_04_19_095256_create_admins_table.php -> this is the name that generate when i run the command "php artisan make:migration... "
    -- it does not show on my data base when i run the command "php artisan migrate"
    .....
    but when i change the name of the migration it runs. I change the migration name of "2018_04_19_095256_create_admins_table.php" to "2014_04_19_095256_create_admins_table.php".
    -- is there any way that i can use the generate name for my migration?
    NOTE: i am using laravel 5.6.12

  • @alsenakeesh778
    @alsenakeesh778 6 лет назад

    hi! I encounter this error
    Type error: Argument 2 passed to Illuminate\Auth\SessionGuard::__construct() must be an instance of Illuminate\Contracts\Auth\UserProvider, null given, called in C:\Users\Shiffer\Desktop\corona\firstlaravel\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php on line 123
    I experience this error when i added auth:admin in Admincontroller
    $this->middleware('auth:admin');
    what does this error mean

  • @palwashaahadyar7924
    @palwashaahadyar7924 7 лет назад

    Hello, I follow your video but I am facing the bellow problem, would you please solve my problem???
    (1/1) TokenMismatchException
    in VerifyCsrfToken.php (line 68)

  • @isfanrachmad8545
    @isfanrachmad8545 2 года назад

    Thanks Dude. I'm almost frustated learn auth Laravel. But you explain it easily ....

  • @sayamk3004
    @sayamk3004 4 года назад +1

    Made my first ever login panel. Thanks man!

  • @manojchowrasiya8527
    @manojchowrasiya8527 7 лет назад

    Hi Alex, can you provide tutorial for Roles Management for Multi Auth.Thanks.

  • @rachelsaurus28
    @rachelsaurus28 7 лет назад

    Sorry, how do I redirect from a Request in Laravel 5.4? In 5.3 I put redirect()->back() in ForbiddenResponse(), but that doesn't seem to exist any more, and putting a redirect like that in failedAuthorization() doesn't work

  • @bfh891
    @bfh891 7 лет назад

    What about registering the Admin middleware in Kernel.php 'admin' => \App\Http\Middleware\Admin::class, inside protected $routeMiddleware, below guest and throttle

  • @toufikforu
    @toufikforu 4 года назад

    New Error ISSUE:::::: I have been using this last 7 to 8 months without any ISSUE. But am getting error today while i tried to Register a New USER. I searched a composer command and i did that now am getting error again like this: Class'Ramesy\Uuid\Uuid' not found. where should i add this class ? please help me anyone.

  • @MdShamimRezabanglasong
    @MdShamimRezabanglasong 6 лет назад

    thanks lot brother.....its work perfectly ..... but i face a little problem that i can't get name of session admin.... Auth::user()->name; we get name by default of users name.....but how can i find name from admin session Auth::admin()->name; its not working........so plz help me

  • @onlennon
    @onlennon 7 лет назад

    thanks .... nice video, i can learning with your videos.... thx @_jacurtis

  • @thinkbig358
    @thinkbig358 6 лет назад

    What is used in place of admin to post something to the database.
    default:
    $post->user_id = auth()->user()->id; -> it worked.
    my code for admin :
    $post->admin_id = auth()->Admin()->id; - > Error:Admin() not found.
    so what i should use for that method .

  • @scheme4685
    @scheme4685 7 лет назад

    Alex, you might want to look into your video quality settings; It's fine, but it's not right for 1080p. It's blurry and your webcam in this video looks like it's frame blending a low framerate...

  • @khafitbimo9825
    @khafitbimo9825 5 лет назад

    How about multi auth with one table, I have any users (superadmin,admin,user) in one table with different roles. example :
    - superadmin, can open page of 3 users (superadmin page, admin page, user page)
    - admin only can open page self page and user page, admin can't open superadmin page
    - user only can open self page, and can't open superadmin page and admin page.
    Thanks and sorry about my english.. :D

  • @arunsaw4387
    @arunsaw4387 7 лет назад

    Hello sir,
    i want to ask related to Mailable.
    how i can change text that come in INBOX in email.
    and whats usfull MARKDOWN or normal mail.
    i am litil bit confused about this, because i am new in laravel.
    so please help me
    Thanks

  • @dbiswas
    @dbiswas 6 лет назад

    Elon !, Thanks for such great tutorial. Already thumb's up !!! Wish had 5 thumb :)

  • @batboy143
    @batboy143 3 года назад

    would this still work on Laravel Framework version 7.28.1?

  • @amitpri1
    @amitpri1 7 лет назад +2

    what steps are different in laravel 5.5

  • @Villafana41
    @Villafana41 7 лет назад +1

    Dude you are awesome, just when I was giving up on learning Laravel I found your channel! Thanks.

  • @OshadhiVindhyani
    @OshadhiVindhyani 5 лет назад

    warning in advance!!!!! guys do not try with this laravel 5.8. bcz if u do you will have hell of time spending on documentation. bcz some functions are little bit different than 5.4

  • @imranshabbir3517
    @imranshabbir3517 4 года назад

    can you please, how I can do email verification in multiple authentications? currently, I am using laravel 5.8

  • @LuisEzequielDeLuca
    @LuisEzequielDeLuca 7 лет назад

    Hey this is really cool!!! do have anything done for LDAP, I am using adldap2 that works fine, I would like to know how Laravel handles or knows what user is logged and how to work with that. Thanks!

  • @eeshirodeku4395
    @eeshirodeku4395 7 лет назад

    Hello Everyone Especially to JACurtis.
    I want to ask if it is okay to use this method in this tutorials in laravel 5.3?
    Do they have the same way in creating multi auth?
    I really need your reply asap

  • @gabsaldana4019
    @gabsaldana4019 7 лет назад

    Thanks!, I have a question... why you are not using the LoginController that comes in the Auth directory? Is it better this way?

  • @sharaharoon2391
    @sharaharoon2391 6 лет назад

    there is already migrated table in CLI(laravel 5.1) ,how to get the table in local host ,using wamp server

  • @egyleader
    @egyleader 5 лет назад

    UPDATE :: Please all save yourself some time and watch this tutorial : ruclips.net/video/yKxR8TQrr2A/видео.html
    I don't mean that @DevMarketer is bad or anything but I think this method will not work in production if you have more than 2 roles of users or any big application that require all users to login from the same form !!!!!! hope you update it with more advanced and yet simple tutrial soon =>>>
    Hi , I like you and your videos but this is the first time I don't know why you did it that way ???? you mean that if I have 5 different roles I have to do this for Every role ?? why can't I have a column in the table of user as "role" and make authentication and redirecting based on the role of the user ????

  • @nikhilambre6698
    @nikhilambre6698 7 лет назад

    Great video @devMarketer, I want to add token based (passport) authentication along with session based login for a dashboard using laravel as restful api. Is it possible? Session login for customers login on website and token login for dashboard integrated with token based.

  • @max82fr
    @max82fr 7 лет назад +1

    Hi Alex, Great tutorial thank you! Thanks so much!

  • @iaskakho5646
    @iaskakho5646 10 месяцев назад

    Any reason as to why you stopped creating content? Your work is great I would love to see more!!!!

  • @mdjubair9122
    @mdjubair9122 6 лет назад

    I can't laravel authentication ...when do migrate this show message prntscr.com/hmv6u6

  • @angelm8387
    @angelm8387 3 года назад

    how to we make password resets work
    in production? Everything works good locally but doesn't work on heroku server.

  • @generreyes7806
    @generreyes7806 6 лет назад

    i got this problem "Undefined Index:Model" can someone help?

  • @DeepakSharma-hl2lz
    @DeepakSharma-hl2lz 5 лет назад

    Hello DevMarketer i hope you well, I need your help to make custome multi auth system in laravel. i know you have already made an awesome videos for that. but i have installed laravel5.8 version and i am consufed how to manage it for different users logout and redirect. please contact me as soon as possible.

  • @hosannaamane6031
    @hosannaamane6031 4 года назад

    Awesome video. Great teacher. Useful content. Thanks a lot

  • @komalwath7661
    @komalwath7661 5 лет назад

    sir,I am done with my admin panel code,login panel is already that I've created in my project in which I've already added admin's user id and password but now i need to add credentials for different different employees how would I do this by using same login panel??

  • @algeriennesaffaires7017
    @algeriennesaffaires7017 4 года назад

    Oh my God i spent a lot of time searching you are the only one that explain it the right way. thank you

  • @abdlerhmanmohamed438
    @abdlerhmanmohamed438 7 лет назад

    Hey bro thk for ur wonderful tutorials . they are gust great ,
    another thing , can u plz plz list all of ur packages u installed in sublime , i know this could take some time .so plz gust send me what u can ! thks in advance.

  • @isaacsouza17
    @isaacsouza17 2 года назад

    Why you stopped making Laravel videos? You had some of the best tutorials I have seen, huge loss for the Laravel community

  • @Zillah_x
    @Zillah_x 4 года назад

    There is so much duplicate code. Why does laravel do that? Why can't we have admins inherit from users?

  • @aungkaungmyat846
    @aungkaungmyat846 2 года назад

    Wow Thanks U!Great Video!Keep on..🥰🥰

  • @trying2bepotatodeveloper869
    @trying2bepotatodeveloper869 6 лет назад

    Bro. How should i deal with multiple admin roles? like the ones you mentioned: super admin, editor, author. Could you kindly make a video on that please? I main point i want to know is how to register editors, authors from super admin.

  • @traditionalcraft1919
    @traditionalcraft1919 2 года назад

    Why it's not working on me, I did exactly what the video said but I think the only problem is my middleware who won't let me go to the intended page. Even if my credentials are correct hopefully u will notice me, been having this problem all over again and again no matter what laravel auth guard video I am following.

  • @KarunJaraslertsuwan
    @KarunJaraslertsuwan 7 лет назад

    Thannk you so much. You explain it very clear make me understand it.

  • @natandematos3945
    @natandematos3945 7 месяцев назад

    You're amazing! Your video saved my life today!

  • @webontutorials9763
    @webontutorials9763 4 года назад

    Sir If we can make a multi-user authentication using meddleware, then why use guard can u explan pls

  • @arnoldabbah9166
    @arnoldabbah9166 5 лет назад

    I have really enjoyed your video's, but I have a small challenge trying to fetch the user or the admin names to show in my application but as u did with yours it works but not working as I try to use it to build my app

  • @simonetz7036
    @simonetz7036 4 года назад

    helooo you are such a great trainer on how you provide an informative explanations.
    thanks thanks

  • @hardrockstartushki
    @hardrockstartushki 4 года назад

    Great tutorial .....saving lives of many developer ....keep it up

  • @josiahilesanmi8144
    @josiahilesanmi8144 7 лет назад

    JaCurtis your tutorials are helpful and amazing, Please can your do a short series on how to use cron jobs in laravel. i have searched i have not really found a very useful tutorial on cron jobs. thank you.

  • @geraldmuvengei
    @geraldmuvengei 6 лет назад

    really awesome bros! It worked with laravel 5.6 thaaanks dude

  • @MrKaremnour
    @MrKaremnour 6 лет назад

    hello guys, if you want to use one table for (admin or users), just follow same steps but in admin model just add
    protected $table = 'users';

  • @venkatamohankumargoli4994
    @venkatamohankumargoli4994 4 года назад

    Great!!!!
    And Can you please tell us how to the multi auth in laravel 5.1 ?

  • @stevenyeo8883
    @stevenyeo8883 4 года назад

    your video was very good Explanation! i am new to laravel do you have an video about GATE laravel?

  • @evanflash6585
    @evanflash6585 4 года назад

    To start with 6 or higher composer require laravel/ui and then php artisan ui:auth ..

  • @samuellujandeoliveira9350
    @samuellujandeoliveira9350 4 года назад

    What an incredible video brow! Thank you! :)

  • @xEesien
    @xEesien 7 лет назад

    The part 1 and part 2 video links are the same. Please check, if im not mistaken the link for part 1 is wrong.

  • @ralphordanza3487
    @ralphordanza3487 6 лет назад

    Hi! How can we modify the field names of an authenticatable model? Thanks in advance!

  • @ramanshrestha5970
    @ramanshrestha5970 4 года назад

    Please make one for laravel 6....in laravel 6 the authentication folder is in app file but and not in vendors so it doesn't send exception

  • @juanrincon6576
    @juanrincon6576 7 лет назад

    why when y press the register button nothing happens? I mean, return to the register form but nothing else happens :S i'm doing the same thing that you "except that my project is not a clean one"

  • @TheSanchezz22
    @TheSanchezz22 7 лет назад

    I got maybe stupid question but i got error because of that so i must ask ....why i Routes is two type of slash ?

  • @amitsonar3511
    @amitsonar3511 7 лет назад

    hello can u make social media like facebook . i wonder how features like chat, video call etc are codded

  • @knowledgebase7284
    @knowledgebase7284 7 лет назад

    Hello DevMarketer, do u know how to save a multiple rows of records from one database table to another table at the same database? Thanks.

  • @abdallakaram5376
    @abdallakaram5376 4 года назад

    Thanks Master Love From Egypt

  • @toufikforu
    @toufikforu 5 лет назад

    Do you have any update version for this Multi Auth for Laravel ?

  • @peterfuttrup7008
    @peterfuttrup7008 4 года назад

    Really useful video - great work... I get it now :)

  • @donnyyu7298
    @donnyyu7298 7 лет назад

    Your video is really good, nice and clear, easy to follow. Thank you