Support the ongoing development of Laravel.io →
posted 9 years ago
IOC

Hello, I have a lot of repetitive repository classes, like:

class UserRepository extends Repository { ... }

class PostRepository extends Repository { ... }

with same code inside..

Is there a way to dynamically load repositories so if AnythingRepository is called, it will return extended repository?

Last updated 2 years ago.
0

Since it's the same code, why don't you put it in Repository?

0

Some repositories have additional methods, so that won't work.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.