Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Yorkata's avatar

Laravel roles and permissions

I am trying to implement this type of management in my application. Since I haven't done anything like that before this is the guide I followed: https://www.honeybadger.io/blog/user-roles-permissions-in-laravel/

And it worked like a charm!

What I wanted to do is change the migrations to alter the tables (they are made to work instantly in every project) The new tables follow the same logic but the problem comes from the model_type column in the model_has_permissions table. I removed this column and changed the model_id to refer to my user_id to make it look simpler. But in every query the application makes it adds the model_has_permissions.model_type which resolves an error. I wonder have any of you guys have done this implementation before and do you have any ideas on what to edit to remove this column from the queries?

Any and all help greatly accepted!

0 likes
0 replies

Please or to participate in this conversation.