Thank you :)!
Laravel allows you binding Interfaces To Implementations. This means lara-repository already do it for you. \App\Repositories\Staff\StaffInterface::class => \App\Repositories\Staff\StaffRepository::class, lara-repository injects the StaffRepository when a class needs an implementation of StaffInterface.
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.
Great article! Would it be at all possible to see how to use the repositories in controllers?
Thank you for your question :)
Yes, you can use repositories by manually adding them
Is the
UserInterface
an entity? A Repository? Also, why would you suffix a property name withinterface
when it's an object?Thank you :)!
Laravel allows you binding Interfaces To Implementations. This means
lara-repository
already do it for you.\App\Repositories\Staff\StaffInterface::class => \App\Repositories\Staff\StaffRepository::class,
lara-repository
injects the StaffRepository when a class needs an implementation of StaffInterface.