Open kapkory opened 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.
Oh @kapkory , I am experiencing the same issue.
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 .
That's a great way to add your function. Thanks
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', ]);