I have two Eloquent models which are very similar but based on different database tables. I would like to create one repository to unify the access of these two Eloquent models.
Usually for one Eloquent model, I would write
class ARepository extends AbstractRepository implements ARepositoryInterface
{
public function __construct(A $A)
{
$this->model = $A;
}
}
But for two Eloquemnt models, A and B. How can I assgin two models to $this->model at the same time, or let $this->model to be one of them at run time? Thanks.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire