PHPackages                             mahmoud-abdelhamid1/laravel-pattern-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mahmoud-abdelhamid1/laravel-pattern-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mahmoud-abdelhamid1/laravel-pattern-generator
=============================================

Generate Repository-Service-Controller patterns in Laravel

v1.0.2(4mo ago)00MITPHPPHP ^8.1|^8.2|^8.3

Since Jan 8Pushed 4mo agoCompare

[ Source](https://github.com/Mahmoud-Abdelhamid1/laravel-pattern-generator)[ Packagist](https://packagist.org/packages/mahmoud-abdelhamid1/laravel-pattern-generator)[ RSS](/packages/mahmoud-abdelhamid1-laravel-pattern-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Pattern Generator
=========================

[](#laravel-pattern-generator)

Generate Repository-Service-Controller patterns in Laravel with a single command.

Features
--------

[](#features)

- ✅ Automatic Controller, Service, Repository generation
- ✅ Interface-based architecture
- ✅ Form Request validation classes
- ✅ Module-based organization
- ✅ API Response trait included
- ✅ Exception handlers for consistent API responses

Installation
------------

[](#installation)

```
composer require mahmoudabdelhamid/laravel-pattern-generator
```

Usage
-----

[](#usage)

```
php artisan make:pattern {name} {module} --model={ModelName}
```

### Examples

[](#examples)

```
# Create Vacation pattern in HR module
php artisan make:pattern Vacation Hr --model=Vacation

# Create Employee pattern in HR module
php artisan make:pattern Employee Hr --model=Employee

# Create User pattern in Global module
php artisan make:pattern User Global --model=User
```

Generated Structure
-------------------

[](#generated-structure)

```
app/
├── Http/Controllers/{Module}/
│   └── {Name}Controller.php
├── Services/{Module}/
│   ├── Interfaces/
│   │   └── {Name}ServiceInterface.php
│   └── {Name}Service.php
├── Repositories/{Module}/
│   ├── Interfaces/
│   │   └── {Name}RepositoryInterface.php
│   └── {Name}Repository.php
└── Http/Requests/{Module}/{Name}/
    ├── StoreRequest.php
    └── UpdateRequest.php

```

Using ApiResponser Trait
------------------------

[](#using-apiresponser-trait)

```
use MahmoudAbdelhamid\PatternGenerator\Traits\ApiResponser;

class YourController extends Controller
{
    use ApiResponser;

    public function index()
    {
        $data = ['message' => 'Success'];
        return $this->successResponse('success', $data);
    }

    public function error()
    {
        return $this->errorResponse('Something went wrong', 400);
    }
}
```

Post-Generation Steps
---------------------

[](#post-generation-steps)

1. Create routes in `routes/api.php`:

```
Route::apiResource('hr/vacations', VacationController::class);
```

2. Ensure your model exists:

```
php artisan make:model Vacation -m
```

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^10.0 or ^11.0

License
-------

[](#license)

MIT License

Author
------

[](#author)

Mahmoud Abdelhamid

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance77

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b22893a610d9ce2cb207c4fe5d4b55dec71b1f4ec0ebc1ac492fe49d4f4e17b?d=identicon)[Mahmoud-Abdelhamid1](/maintainers/Mahmoud-Abdelhamid1)

---

Top Contributors

[![Mahmoud-Abdelhamid1](https://avatars.githubusercontent.com/u/101946952?v=4)](https://github.com/Mahmoud-Abdelhamid1 "Mahmoud-Abdelhamid1 (4 commits)")

---

Tags

laravelgeneratorservicerepositorypattern

### Embed Badge

![Health badge](/badges/mahmoud-abdelhamid1-laravel-pattern-generator/health.svg)

```
[![Health](https://phpackages.com/badges/mahmoud-abdelhamid1-laravel-pattern-generator/health.svg)](https://phpackages.com/packages/mahmoud-abdelhamid1-laravel-pattern-generator)
```

###  Alternatives

[getsolaris/laravel-make-service

A MVCS pattern create a service command for Laravel 5+

81161.3k](/packages/getsolaris-laravel-make-service)[prevailexcel/laravel-action-service-trait

A simple Laravel package to create actions, traits and services using artisan commands

143.0k](/packages/prevailexcel-laravel-action-service-trait)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
