bugover/laravel-repository
Laravel package providing a repository layer to abstract Eloquent data access. Includes base repository classes, common CRUD methods, query helpers, and patterns for cleaner, testable service code in your Laravel apps.
illuminate/http dependency).find(), all(), where()).User, Product, Category) to validate the repository layer.// Before
$users = User::where('active', true)->get();
// After
$users = app(UserRepository::class)->scopeActive()->all();
class UserRepository extends BaseRepository
{
protected $cacheTags = ['users', 'active_users'];
protected $cacheTTL = 300; // 5 minutes
}
delete() should invalidate users tag).composer.json to avoid unexpected updates:
"bugover/laravel-repository": "1.5.7"
illuminate/http dependency in Laravel 11+).creating, updating) may interfere with caching if not disabled (as noted in release 1.2.6).// Before
$user = User::findOrFail($id);
// After
$user = app(UserRepository::class)->findOrFail($id);
interface UserRepositoryInterface {
public function findOrFail(int $id);
}
active_users).update() should invalidate tags).How can I help you explore Laravel packages today?