I am developing a system that when sending data by the form is returning me this error :
BindingResolutionException in Container.php line 763: Target [Church \ Repositories \ MemberRepository] is not instantiable while building [Church \ Http \ Controllers \ MemberController, Church \ Services \ MemberService].
I have already done a search and the solutions that are presented to me are related to namespace
, but I have already looked at it several times, deleted it, created it again, etc. and the error persists. I've been stuck here for two days. Using Laravel 5.3
and prettus repository 2.6
.
Follow other documents:
Model Membro.php
<?php
namespace Igreja\Entities;
use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;
class Membro extends Model implements Transformable {
use TransformableTrait;
protected $table = 'membros';
protected $fillable = [
'desde',
'pretencoes_funcoes_id',
'pretencoes_profissionais_id',
'pretencoes_cursos_id'
];
}
Service MembroService.php
<?php
namespace Igreja\Services;
use Igreja\Repositories\MembroRepository;
use Igreja\Entities\Membro;
class MembroService {
private $repository;
public function __construct(MembroRepository $repository)
{
$this->repository = $repository;
}
}
Folder structure