Closed ibpavlov closed 7 years ago
@ibpavlov I think you're right about it - here it'd be better to use the constructor to initialize the model.
@hasib32 you should update the AbstractEloquentRepository
class to reflect this change
@ibpavlov Thanks for the recommendation. If you want you can create a pull request for the change.
I have a problem mocking the Model of a Repository. Now the class is directly used in your code and the only way to Mock it is to overwrite it using Reflection, which is not the best practice.
Isn't it better to use the assignment in the construction like:
Please tell me what you think about this approach.