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

Markz's avatar

Where do I put the Entrust roles and permissions?

Here:

https://github.com/Zizaco/entrust#concepts

it says, "Let's start by creating the following Roles and Permissions:"

But I don't know where to put that code.

Any tips/advice?

Thanks!

0 likes
3 replies
jekinney's avatar

I create seeders for that code. Generally you always need some roles and permissions to start with.

Markz's avatar

I'm sorry, I don't know what you mean. I'm asking where I put this:

$owner = new Role(); $owner->name = 'owner'; $owner->display_name = 'Project Owner'; // optional $owner->description = 'User is the owner of a given project'; // optional $owner->save();

$admin = new Role(); $admin->name = 'admin'; $admin->display_name = 'User Administrator'; // optional $admin->description = 'User is allowed to manage and edit other users'; // optional $admin->save();

Please or to participate in this conversation.