I am using Laravel and Sentinel for my authentication.
Authentication works fine, I can log in using Sentinel and get back a User and I can see all of the User's fields.
However, I cannot access it's relationships (other than the Sentinel roles).
$user = Sentinel::findById($userId);
dd($user->telephones); // returns null
$user = App\User::find($userId);
dd($user->telephones); // displays a dump of the associated eloquent collection
Is there a way to retrieve the eloquent User from Sentinel so I can look at it's relationships?
In your User
model extend Sentinel EloquentUser
.
class User extends EloquentUser
And in your catalyst sentinel config
set user model like-
'users' => [
'model' => 'App\User',
],
And don't forget to run-
php artisan config:clear
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With