repository-generator

Generate Laravel repository classes with interfaces, implementations, and CRUD methods via Artisan commands.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/idehen-divine/lumished --skill repository-generator-idehen-divine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: repository-generator
Source: https://github.com/idehen-divine/lumished/tree/main/.agents/skills/repository-generator
Command: npx skills add https://github.com/idehen-divine/lumished --skill repository-generator-idehen-divine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually writing repository interfaces and implementations for every Eloquent model is repetitive boilerplate work. This Skill generates repository classes with consistent CRUD patterns, service pairing, and feature-based organization so you can establish a clean data access layer quickly. ## Core Features & Use Cases - Repository Generation: Create interface and implementation pairs with php artisan make:repository User, optionally with paired services via --service or --api flags. - Model-Integrated Scaffolding: Generate repositories directly from models using php artisan make:model User --repository. - Feature Organization: Place repositories in subdirectories by domain (Admin, Blog, Shop) with commands like php artisan make:repository Blog/Post --service. - Use Case: When building a blog module, generate Blog/PostRepository and Blog/CommentRepository with services, then add query methods like published(), search(), and paginate() following the documented Eloquent patterns. ## Quick Start Generate a repository with a paired service for the Post model and organize it under the Blog feature directory.

Frequently Asked Questions about repository-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a repository class in Laravel?▼

Run php artisan make:repository User to generate an interface and implementation pair in app/Repositories. Add the --service flag to also create a paired service class, or use --api for API-oriented scaffolding.

How to generate a Laravel model with repository and service?▼

Use php artisan make:model User --repository to create the model alongside its repository. The shorthand php artisan make:model Post -sr -rt generates the model with both service and repository in one command.

Can I organize Laravel repositories into subdirectories by feature?▼

Yes, pass a path prefix like php artisan make:repository Blog/Post --service to place files under app/Repositories/Blog. This supports domain-driven organization for features such as Admin, Blog, or Shop.

How does the repository access the Eloquent model?▼

The generated implementation receives the model through constructor injection, resolved automatically by Laravel's service container. All data access methods like find, create, and update operate on this injected model instance.

What query methods can I add to a Laravel repository?▼

Common additions include updateOrCreate, firstOrCreate, paginate, search with where clauses, and eager loading via with() to avoid N+1 queries. A query() method exposes the raw query builder for complex filtering.