protected function build(string $modelClass): IRepository
    {
        $repositoryClass = $this->registeredRepositories[$modelClass] ?? Repository::class;

        $parameters = [];

        if ($repositoryClass === Repository::class || is_subclass_of($repositoryClass, Repository::class)
        ) {
            $parameters = ['modelClass' => $modelClass];
        }

        return $this->container->make($repositoryClass, $parameters);
    }
protected function build(string $modelClass): IRepository
    {
        $repositoryClass = $this->registeredRepositories[$modelClass] ?? Repository::class;

        $parameters = [];

        if ($repositoryClass === Repository::class || is_subclass_of($repositoryClass, Repository::class)
        ) {
            $parameters = ['modelClass' => $modelClass];
        }

        return $this->container->make($repositoryClass, $parameters);
    }
protected function build ( string $ modelClass ) : IRepository { $ repositoryClass = $ this -> registeredRepositories [ $ modelClass ] ?? Repository :: class ; $ parameters = [ ] ; if ( $ repositoryClass === Repository :: class || is_subclass_of ( $ repositoryClass , Repository :: class ) ) { $ parameters = [ 'modelClass' => $ modelClass ] ; } return $ this -> container -> make ( $ repositoryClass , $ parameters ) ; }
Build repository by model class from registered instances or creates default.

@param string $modelClass Model class

@return IRepository

@throws BindingResolutionException
Build repository by model class from registered instances or creates default .