romanbican / roles

Powerful package for handling roles and permissions in Laravel 5
MIT License
1.16k stars 297 forks source link

where do you place this code in romanbican/role, am new in laravel, i tried placing in a role model but it was highlighted with red #179

Open kapkory opened 8 years ago

kapkory commented 8 years ago

use Bican\Roles\Models\Role;

$adminRole = Role::create([ 'name' => 'Admin', 'slug' => 'admin', 'description' => '', // optional 'level' => 1, // optional, set to 1 by default ]);

$moderatorRole = Role::create([ 'name' => 'Forum Moderator', 'slug' => 'forum.moderator', ]);

muneebarif11 commented 8 years ago

You can create a view for roles to create and in store method of you class, you can put your above code there.

yong0011 commented 8 years ago

Oh @kapkory , I am experiencing the same issue.

kapkory commented 8 years ago

i didn't use it altogether, i placed a function authenticated in my authcontroller, and placed my redirection code and it worked fine

On Tue, Jun 28, 2016 at 8:52 AM, YongCS notifications@github.com wrote:

Oh @kapkory https://github.com/kapkory , I am experiencing the same issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/romanbican/roles/issues/179#issuecomment-228955094, or mute the thread https://github.com/notifications/unsubscribe/AS80I2foiGl3vWa5lXeOT9J3JXp_6a5iks5qQLa1gaJpZM4IzgfT .

yong0011 commented 8 years ago

That's a great way to add your function. Thanks