I have set up a repository interface and a repository class
namespace Repository\Findbrok\Contracts;
/**
Interface UserRepositoryInterface
@package Repository\Findbrok\Contracts */ interface UserRepositoryInterface {
public function getRegisteredUsers();
}
namespace Repository\Findbrok;
use Repository\Findbrok\Contracts\UserRepositoryInterface;
/**
Class UserRepository
@package Repository\Findbrok */ class UserRepository implements UserRepositoryInterface {
public function getRegisteredUsers() { return 3; }
}
I binded it in the register method of the AppServiceProvider like so
//Bind user repository of findbrok $this->app->bind('Repository\Findbrok\Contracts\UserRepositoryInterface', 'Repositroy\Findbrok\UserRepository');
But when I am trying to acces it in my controller using injection in my constructor i am getting an InvalidArgumentException
/** * Class Constructor */ public function __construct(FindbrokUserRepository $repo) { }
Can anyone help me?
I realised my mistake a typo in the class name when i binded my interface to my class.
My MIstake
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community