classSetProfileImage{private$image_store;// Is this $image_repo?
Also, I have another question, in class EloquentUserRepostiory you are using Domain\User and function get return Domain\User, is it an Eloquent model?
If it is an Eloquent model, how do you implement the repository with MongoDB, which isn't supported by Eloquent?
Maybe, we should use Entity instead of Eloquent Model?
Lead Developer and Solutions Architect, I specialise in Event Sourcing, DDD and Event Driven systems. PHP and GoLang developer. Enjoys being a smart ass and having a nice whiskey.
Location
Ireland
Education
MSc in Computer Science, Trinity College, Dublin
Work
Lead Developer and Solutions Architect at Contractor
Thanks for pointing that out, I'll correct it shortly.
You are correct, the above get call would return an eloquent model, which isn't ideal. If I were to take this code example further, I would create a domain class for User that is completely independent from Eloquent, and then translate from it to the Eloquent model inside the repository.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for interesting article!
A minor mistake in class
SetProfileImage
:Also, I have another question, in class
EloquentUserRepostiory
you are usingDomain\User
and functionget
returnDomain\User
, is it an Eloquent model?If it is an Eloquent model, how do you implement the repository with MongoDB, which isn't supported by Eloquent?
Maybe, we should use Entity instead of Eloquent Model?
Hi Tuam,
Thanks for pointing that out, I'll correct it shortly.
You are correct, the above
get
call would return an eloquent model, which isn't ideal. If I were to take this code example further, I would create a domain class forUser
that is completely independent from Eloquent, and then translate from it to the Eloquent model inside the repository.