Support the ongoing development of Laravel.io →
posted 9 years ago
Security
Last updated 1 year ago.
0
$permissions = $role->perms;
0

$role = Role::find(1);

$perms = $role->perms();

echo $perms->name;

i have tried the code above but its return an error that says undefined property $name

Last updated 9 years ago.
0

Man i didn't use perms() because it returns the relation object. I used $role->perms without parenteses

0

Thank you Dishark,, it is working now..

0

Sign in to participate in this thread!

Eventy

Your banner here too?

tadoshi tadoshi Joined 17 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.