faruque-ashad/laravel-solid-repository-scaffold

Laravel project scaffold with SOLID & Repository pattern

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/faruque-ashad/laravel-solid-repository-scaffold

1.0.0 2026-01-20 17:20 UTC

This package is auto-updated.

Last update: 2026-01-20 17:27:42 UTC


README

A production-ready Laravel package to rapidly scaffold Model, Repository, Service, and Filter layers following SOLID principles and the Repository Pattern.

Built for clean architecture, maintainability, and scalable Laravel applications.

✅ Supports Laravel 10, 11, and 12

Features

  • One-command module scaffolding
  • SOLID & Repository Pattern based architecture
  • Service layer abstraction
  • Clean and predictable folder structure
  • Prevents overwriting existing files
  • Laravel auto-discovery enabled

Requirements

  • PHP ^8.0
  • Laravel ^10.0 | ^11.0 | ^12.0

Installation

Install via Composer:

composer require faruque-ashad/laravel-solid-repository-scaffold

Usage

Generate a complete module using one command:

php artisan make:module Blog

Generated Structure

app/
├── Models/
│   └── Blog.php
│
├── Repositories/
│   ├── Contracts/
│   │   ├── RepositoryInterface.php
│   │   └── BlogRepositoryInterface.php
│   └── Eloquent/
│       └── BlogRepository.php
│
├── Services/
│   └── Blog/
│       ├── BlogService.php
│       └── BlogServiceInterface.php
│
└── Helpers/
    └── Filter/
        └── BlogFilter.php

Generate Specific Layers

You can generate individual layers using the --only option:

php artisan make:module Blog --only=model
php artisan make:module Blog --only=repository
php artisan make:module Blog --only=service
php artisan make:module Blog --only=filter

Architecture Principles

This package enforces:

  • Single Responsibility Principle
  • Dependency Inversion
  • Repository Pattern
  • Service Layer abstraction
  • Clean separation of concerns

Each layer is isolated and testable, ensuring long-term maintainability.

Behavior Notes

  • RepositoryInterface is auto-generated if missing
  • Existing files are never overwritten
  • Filters are scaffolded but not automatically applied
  • Service layer acts as the main business logic boundary

Ideal Use Cases

  • Large Laravel applications
  • API-driven projects
  • Clean architecture enforcement
  • Team-based development
  • Long-term maintainable codebases

License

MIT License © Ashaduzzaman Faruque