Support the ongoing development of Laravel.io →
Packages Architecture

Should I use a package for reusing the code when implementing repositories or should I write all the code from the scratch.

I mean repository methods that usually are listed in AbstractRepository.

This package anlutro/laravel-repository has descent amount of methods in its abstract classes, but lacks an interface to be extended in my RepositoryInterfaces

This one ipunkt/laravel-repositories has an interface to be extended from but has a lower number of methods and reputation.

What do you usually do?

Last updated 2 years ago.
0

I wrote mine from scratch just for the learning curve, repositories and interfaces inside my application namespace. Interfaces are not needed they are just good for future proofing if you wish to swop out for another ORM but I agree, the abstract interface should exist. Could you not contribute an interface to the solution you prefer?

Last updated 2 years ago.
0

Thanks, what do you think about the usefulness of this package anlutro/laravel-repository

I'm new to repositories, and can`t judge it completely.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mtvs mtvs Joined 28 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.