The repository pattern and Eloquent are not competitors, you can use Eloquent inside a repository, it's particularly useful when you need more functionality that makes the Eloquent Query weird, it can also make your code more legible with stuff like getAdmins or getActiveUsers instead of the direct query – also, having the query in one place instead of multiple will allow you to reduce errors
If you don't need to re-use the queries then a Repository is overkill anyway – Even though, it can still provide value depending on the complexity of the queries.
I've seen it used in Laravel apps before, in conjunction with the Service Pattern, this was a massive codebase though.
YAGNI and KISS always in mind!
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.
The repository pattern and Eloquent are not competitors, you can use Eloquent inside a repository, it's particularly useful when you need more functionality that makes the Eloquent Query weird, it can also make your code more legible with stuff like getAdmins or getActiveUsers instead of the direct query – also, having the query in one place instead of multiple will allow you to reduce errors
If you don't need to re-use the queries then a Repository is overkill anyway – Even though, it can still provide value depending on the complexity of the queries.
I've seen it used in Laravel apps before, in conjunction with the Service Pattern, this was a massive codebase though.
YAGNI and KISS always in mind!