Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Laravel Authorization


Hi,
I'm using Metronic 8 with Laravel, and there are some tables such as 'roles', 'permissions', 'role_has_permissions', 'model_has_roles' and 'model_has_permissions' to handle authorization.

I couldn't figure out how to use these tables, especially last two tables. Also, there is no field in a table to bind users with roles. How should I use these tables? How should I bind users with roles?

Can you help me how to use them? Do you have any documentation for it?

Thanks in advance


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hello,
sorry for my question, i am new in "hobby" coding. I saw you link but sadly didnt find the correct answer yet. In my understanding these roles should be stored in the database bind to the assigned users right? But how did you do that? In code? Start with using your default laravel project for some playing with code.
Thanks for your help.



Hi,

For Metronic Laravel permission feature, we use spatie/laravel-permission plugin.



Thanks



Those tables are from


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(