Laravel 5.6 User Roles & Permissions - unable to access roles or products page - no roles in multi select

Posted in CategoryLaravel
  • J
    Jam0r 1 year ago



    I have followed your tutorial here:



    All went well but when I go onto edit/create user there are no roles in the role multi-select dialogue.  In the permission SQL table I see role-list, role-create, role-edit etc but nothing in the roles or role_has_permissions table.  Have I missed something?


    Example here:


    I had authentication implemented prior to following this tutorial.





  • H
    Hardik Savani 1 year ago

    Can you try this on your user controller PLs ?


    dd($roles = Role::pluck('name','name')->all());


  • R
    Renato 1 year ago

    Estou sem permissao:(User have not permission for this page access)

    I did the same project, I downloaded the one of you, but I can not edit users nor register roles. What has to be done to have user as superuser?

    Because I do not have permission!

  • M
    Martin 1 year ago

    Hi Hardik,

    I have your latest code and i setup in my local pc.

    Everyting is working fine, user created and login success.

    One thing is not working is after login when i check the user role table and user permission table there are no record inserted in the table so when i can check the user permission that time access denied display means you have not right permission to acess this page


    Can you please help me on this?



    Martin Steave

  • G
    Gari 11 months ago


    Same problem here. I can't edit the current users role. Any help will do.


  • F
    Faisal 11 months ago

    Hi good evening 

    i have a problem with add synamic field to form and remove. Any help will do 

    thank you

  • T
    TimoBickert 11 months ago

    Hi Folks, 

    had the same Problem and was able to fix it by manually add a role to the DB  manually

    (This is a workaround - but it worked for me just fine)

    INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES (NULL, 'Admin', 'Web', NULL, NULL);

     this will create a role admin and is now visible in the select field

    now give the Admin role all rights 

    INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES ('2', '1'), ('3', '1'), ('4', '1'), ('5', '1'), ('6', '1'), ('7', '1'), ('8', '1');

    check tablenames and all that stuff 

    Last but not least log in to your account -> Manage User -> Edit your Name and you can give yourself the role Admin



  • K
    Kasiye 9 months ago

    we have one question 

    how to increase payment amount student pay date is past or penality in php mysql ?

    pleace help me!!!

  • B
    Bernard chisumo 9 months ago

    Hi All
    Thank you a nice tutorial for Permission with Laravel .Although I have encourted a small problem when i am trying to access the manage user .This is error

    Call to undefined method App\User::getRoleNames() (View: C:\laragon\www\prpduct-permission\resources\views\users\index.blade.php)

    where is the functionality of getRoleNames() method in users/index.blade.php? Anyone can assist

Please login or register to leave a response.

* You May Also Like Bellow Issue to check *