PHPackages                             gianlu-api/laravel-design - 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. gianlu-api/laravel-design

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

gianlu-api/laravel-design
=========================

Library to generate custom design structure in laravel

0.6.1(1y ago)2143MITPHPPHP ^8.2CI passing

Since Nov 26Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/gianlu-api/laravel-design)[ Packagist](https://packagist.org/packages/gianlu-api/laravel-design)[ RSS](/packages/gianlu-api-laravel-design/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (9)Used By (0)

Laravel Design
==============

[](#laravel-design)

[![badge](https://github.com/gianlu-api/laravel-design/actions/workflows/tests.yml/badge.svg)](https://github.com/gianlu-api/laravel-design/actions/workflows/tests.yml/badge.svg) [![badge](https://github.com/gianlu-api/laravel-design/actions/workflows/larastan.yml/badge.svg)](https://github.com/gianlu-api/laravel-design/actions/workflows/larastan.yml/badge.svg)

Laravel Design is the library that allows you to quickly generate the architecture you desire.

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

[](#requirements)

- PHP ^8.1
- Laravel ^10 || ^11

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

[](#installation)

```
composer require gianlu-api/laravel-design
```

Publish Resources
-----------------

[](#publish-resources)

```
php artisan vendor:publish --tag=gianlu-api:laravel-design:config
```

It is not mandatory to publish the config; you can create your own and specify it when running the command.

Usage
-----

[](#usage)

First, you will need to fill out the configuration as explained below. Once the configuration file is ready, if you are using the laravel-design configuration file run:

```
php artisan design
```

Otherwise, if you are using your own configuration file:

```
php artisan design --config={your_config_name}
```

---

Configurations
--------------

[](#configurations)

it is possible to generate the following types of files:

- migrations =&gt; `'migrations'`
- classes =&gt; `'classes'`
- interfaces =&gt; `'interfaces'`
- abstract classes =&gt; `'abstract_classes'`
- models =&gt; `'models'`
- controllers =&gt; `'controllers'`
    - options: type
- requests =&gt; `'requests'`
- middlewares =&gt; `'middlewares'`
- vue components =&gt; `'vue_components'`
    - options: type
- react components =&gt; `'react_components'`
- blade components =&gt; `'blade_views'`

### you can choose between these types of configuration, you can also mix them if you need

[](#you-can-choose-between-these-types-of-configuration-you-can-also-mix-them-if-you-need)

- name and path configuration

```
'key' => [
   [
       'name' =>'UserService',
       'path' => '/Domains/User/Domain/Services',
   ]
]

```

```
'key' => [
    'name' =>'UserService',
    'path' => '/Domains/User/Domain/Services',
]

```

- path and names configuration

```
'key' => [
    'path' => '/Domains/User/Domain/Services',
    'names' => [
        'UserRetrieverService',
        'UserDataAccessService',
    ]
]

```

```
'key' => [
    [
        'path' => '/Domains/User/Domain/Services',
        'names' => [
            'UserRetrieverService',
            'UserDataAccessService',
        ]
    ],
    [
        'path' => '/Domains/User/Domain/Dtos',
        'names' => [
            'CreateUserData',
            'UpdateUserData',
        ]
    ]
]

```

- name configuration

```
'key' => [
    'name' =>'/Domains/User/Domain/Services/UserService',
]

```

- mixed configuration example

```
'classes' => [
     [
       'name' =>'UserType',
       'path' => '/Domains/User/Domain/Enums',
    ],
    [
        'path' => '/Domains/User/Domain/Services',
        'names' => [
            'UserRetrieverService',
            'UserDataAccessService',
        ]
    ],
    [
        'path' => '/Domains/User/Domain/Dtos',
        'names' => [
            'CreateUserData',
            'UpdateUserData',
        ]
    ]
    'name' =>'/Domains/User/Domain/Repositories/UserRepository',
]

```

Migrations configruration
-------------------------

[](#migrations-configruration)

```
'migrations' => [
    'table' => 'test_domain',
]

```

```
'migrations' => [
    'tables' => ['test_domain', 'test_domain_2']
]

```

Controllers configruration
--------------------------

[](#controllers-configruration)

it is possible for controllers to choose whether api or resource methods should be created as allowed by Laravel, by adding to the configuration array `'type' => api` for api or `type => resource` for resources

Vue Components Configuration
----------------------------

[](#vue-components-configuration)

it is possible for vue components to choose options between composition\_api `'type' => 'compositions'` and `'type' => 'options'`, by default a compositions component is created

Name Passed by Command
======================

[](#name-passed-by-command)

If you want, you can also pass the domain name directly to the command, so you never have to change your config structure once it’s defined like this.

```
[
    "migrations" => [
        "table" => "&"
    ],
    'models' => [
        'name' => '/Domains/&/Domain/Models/&',
    ],
    "classes" => [
        [
            "path" =>"/Domains/&/Domain/Services",
            "names" => ["&RetrieverService", "&DataAccessService"]
        ],
        [
            "path" =>"/Domains/&/Domain/Repositories",
            "name" => "&Repository",
        ]
    ],
    "interfaces" => [
        "path" =>"/Domains//&/DOmain/Interfaces",
        "names" => ["&ServiceRetrieverInterface", "&DataAccessServiceInterface", "&RepositoryInterface"]
    ],
    "abstract_classes" => [
        [
            "path" =>"/Domains/&/Domain/Abstracts",
            "name" => "&Abstract",
        ]
    ],
    "requests" => [
        "name" =>"../../App/Http/&/Requests/&Request",
    ],
    "middlewares" => [
        "name" =>"../../App/Http/&/Middlewares/&Middleware",
    ],
    "resources" => [
        "name" =>"../../App/Http/&/Resources/&Resource",
    ],
    "controllers" => [
        "name" =>"../../App/Http/&/Controllers/&Controller",
    ],
];

```

Now you can run the command like this

```
php artisan design {name}
```

Configuration Example
---------------------

[](#configuration-example)

First, you will need to fill out the configuration file as follows.

```
[
    "migrations" => [
        "table" => "users"
    ],
    'models' => [
        'name' => '/Domains/User/Domain/Models/User',
    ],
    "classes" => [
        [
            "path" =>"/Domains/User/Domain/Services",
            "names" => ["UserRetrieverService", "UserDataAccessService"]
        ],
        [
            "path" =>"/Domains/User/Domain/Repositories",
            "name" => "UserRepository",
        ]
    ],
    "interfaces" => [
        "path" =>"/Domains/User/Domain/Interfaces",
        "names" => ["UserServiceRetrieverInterface", "UserDataAccessServiceInterface", "UserRepositoryInterface"]
    ],
    "abstract_classes" => [
        [
            "path" =>"/Domains/User/Domain/Abstracts",
            "name" => "UserAbstract",
        ]
    ],
    "requests" => [
        "name" =>"../../App/Http/User/Requests/UserRequest",
    ],
    "middlewares" => [
        "name" =>"../../App/Http/User/Middlewares/UserMiddleware",
    ],
    "resources" => [
        "name" =>"../../App/Http/User/Resources/UserResource",
    ],
    "controllers" => [
        "name" =>"../../App/Http/User/Controllers/UserController",
    ],
    "blade_views" => [
         "name" => "UserPage",
    ],
    "vue_components" => [
        "name" => "UserPage",
         "path" => "js/Pages",
    ],
    "react_components" => [
        "name" => "UserPage",
        "path" => "js/Pages",
    ]
];

```

If you want to create only specific components, simply leave the unwanted arrays empty. For example, if you need to create only a migration, model, service, and repository.

```
[
    "migrations" => [
        "table" => "users"
    ],
    'models' => [
        'name' => '/Domains/User/Domain/Models/User',
    ],
    "classes" => [
        [
            "path" =>"/Domains/User/Domain/Services",
            "names" => ["UserRetrieverService", "UserDataAccessService"]
        ],
        [
            "path" =>"/Domains/User/Domain/Repositories",
            "name" => "UserRepository",
        ]
    ],
    "interfaces" => [],
    "abstract_classes" => [],
    "requests" => [],
    "middlewares" => [],
    "resources" => [],
    "controllers" => [],
    "blade_views" => [],
    "vue_components" => [],
    "react_components" => []
];

```

---

Laravel Commands
----------------

[](#laravel-commands)

Add `../../` before the path where you want to create the class; otherwise, the class will be created following Laravel's default path. For example, for the Controller: `name => ../../App/Http/User/Controllers/UserController`, the Controller will be created in `app/App/Http/User/Controllers/UserController`. On the other hand, if we use `name => UserController`, it will be created in `app/Http/Controllers/UserController`.

---

Other Commands
--------------

[](#other-commands)

```
php artisan design:class {class_name} {class_path}
```

```
php artisan design:interface {interface_name} {interface_path}
```

```
php artisan design:class:abstract {abstarct_class_name} {abstract_class_path}
```

```
php artisan design:view:vue {vue_component_name} {vue_component_path} {--type=options || compositions}
```

Default type for Vue components is composition api.

```
php artisan design:view:react {react_component_name} {react_component_path}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance53

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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 ~19 days

Recently: every ~13 days

Total

7

Last Release

424d ago

PHP version history (2 changes)0.1.0PHP ^8.1

0.6.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/acf5d2db149e38aeebcbc8f7f611d935af7f686996c86d46a5ba3b9891905cde?d=identicon)[gianlu-api](/maintainers/gianlu-api)

---

Top Contributors

[![gianlu-api](https://avatars.githubusercontent.com/u/87201979?v=4)](https://github.com/gianlu-api "gianlu-api (64 commits)")

---

Tags

architecturedesignlaravellaravel-frameworkphpphplaravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/gianlu-api-laravel-design/health.svg)

```
[![Health](https://phpackages.com/badges/gianlu-api-laravel-design/health.svg)](https://phpackages.com/packages/gianlu-api-laravel-design)
```

###  Alternatives

[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7012.8k](/packages/tehwave-laravel-achievements)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)

PHPackages © 2026

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