Closed jstojiljkovic closed 2 years ago
I see some developer use interfaces folder and repository folder in a separate folder like: namespace App\Interfaces namespace App\Repositories
And see other user interfaces inside repositories folder like : namespace App\Repositories\Order;
It usually depends on you, what I prefer is to have everything separate, a folder for interfaces and a folder for repositories. That way you know where everything is.
Here is my usual structure:
https://github.com/alijumaan/Laravel-Ecommerce/blob/e1db5c387ce4606a375293b490fe203fa60a0176/app/Http/Controllers/Backend/CategoryController.php#L17
Since you decided to use a Repository pattern, you should create interfaces for each repository and then inject them into the controller, also each class that implements that interface should return the same value not eloquent in that way you are not breaking the Repository pattern.