2

Hi Im working on a login application using slim and cartalyst\sentinel. When i create new instance of sentinel reminder $reminder = new Cartalyst\Sentinel\Reminders\IlluminateReminderRepository; it give an error to implement UserRepositoryInterface error __construct() must implement interface Cartalyst\Sentinel\Users\UserRepositoryInterface.

My Question is how can i implement an interface on run-time in php.

Whereas at above i used activation class which also implement an interface in src code like class IlluminateActivationRepository implements ActivationRepositoryInterface but it do not give error.

This below activation class is working fine.

$activation = (new Cartalyst\Sentinel\Activations\IlluminateActivationRepository)->create($user);
Mika Tuupola
  • 19,877
  • 5
  • 42
  • 49
Shahid Chaudhary
  • 890
  • 3
  • 14
  • 25

1 Answers1

1

Ok i solved by this supplying user repository object.

$users = $app->container->sentinel->getUserRepository();

 $reminder =  new Cartalyst\Sentinel\Reminders\IlluminateReminderRepository ( $users );
Shahid Chaudhary
  • 890
  • 3
  • 14
  • 25