sentinel icon indicating copy to clipboard operation
sentinel copied to clipboard

Sentinel Reminder::exists() error

Open shahidbasheer opened this issue 10 years ago • 2 comments

HI Im getting error with this Reminder::exists($user) function Argument 1 passed to Cartalyst\Sentinel\Reminders\IlluminateReminderRepository::exists() must implement interface cartalyst\Sentinel\Users\UserInterface

here is Code same as on example page.

`$user = Sentinel::findById($credentials);

//dd($user); // this dump user return collection object of user

 $reminder = Reminder::exists( $user );`

shahidbasheer avatar Jul 05 '16 10:07 shahidbasheer

I'm seeing that you're passing $credentials to the findById method, it should be the user id, not an array.

With that said, make sure that what's being returned on $user is really an user object that implements the UserInterface as it seems a logic issue on your application.

brunogaspar avatar Jul 05 '16 10:07 brunogaspar

Thanks it solved. $credential array had user id and findBydId returned laravel collection object that had EloquentUser object. By passing id it returned EloquentUser object.

shahidbasheer avatar Jul 05 '16 11:07 shahidbasheer