PHPackages                             hariadi/laravel-boilerplate-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. [CLI &amp; Console](/categories/cli)
4. /
5. hariadi/laravel-boilerplate-generator

ActiveLibrary[CLI &amp; Console](/categories/cli)

hariadi/laravel-boilerplate-generator
=====================================

Generate Model, attribute, relation, scope trait and repository for Laravel Boilerplate

v2.0.0(5y ago)96093MITPHP

Since Jun 1Pushed 5y ago3 watchersCompare

[ Source](https://github.com/hariadi/laravel-boilerplate-generator)[ Packagist](https://packagist.org/packages/hariadi/laravel-boilerplate-generator)[ Docs](https://github.com/hariadi/laravel-boilerplate-generator)[ RSS](/packages/hariadi-laravel-boilerplate-generator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (21)Used By (0)

Laravel Boilerplate Generator Commands
======================================

[](#laravel-boilerplate-generator-commands)

[![Build Status](https://github.com//hariadi/laravel-boilerplate-generator/workflows/Laravel/badge.svg)](https://github.com/laravel-boilerplate-generator/actions)

Generate Model, attribute, relation, scope trait and repository for [Laravel 5 Boilerplate](https://github.com/rappasoft/laravel-5-boilerplate) via console command

Install
-------

[](#install)

```
composer require --dev hariadi/laravel-boilerplate-generator
```

### Laravel 5.7+

[](#laravel-57)

Package already support auto discover and ready to use.

### Laravel 5.4

[](#laravel-54)

Register service provider by adding to your `config/app.php`:

```
Hariadi\Boilerplate\GeneratorCommandServiceProvider::class,
```

If you want this lib only for dev, you can add the following code to your `app/Providers/AppServiceProvider.php` file, within the `register()` method:

```
public function register()
{
    if ($this->app->environment() !== 'production') {
        $this->app->register(\Hariadi\Boilerplate\GeneratorCommandServiceProvider::class);
    }
    // ...
}
```

Show command list:

```
php artisan list
```

You will see:

```
	app
	  app:attribute        Create a new attribute traits for model
	  app:method           Create a new method traits for model
	  app:model            Create a new Eloquent model class with attribute, relationship and scope traits
	  app:relationship     Create a new relationship traits for model
	  app:repository       Create a new repository class
	  app:scope            Create a new scope traits for model
```

Usage
-----

[](#usage)

### Generate Model

[](#generate-model)

**Options**

- `-N|--namespace` : The namespace class. Output strategy will follow this namespace

```
php artisan app:model ModelName
```

Generate `ModelName.php` under `Models` directory, and traits for `ModelNameAttribute`, `ModelNameRelationship`, `ModelNameScope` under `Models\ModelName\Traits` directory.

### Generate Attribute

[](#generate-attribute)

**Options**

- `-N|--namespace` : The namespace class. Output strategy will follow this namespace

```
php artisan app:attribute ModelName
```

Generate `ModelNameAttribute.php` under `Models/Traits/Attribute` directory.

### Generate Method

[](#generate-method)

**Options**

- `-N|--namespace` : The namespace class. Output strategy will follow this namespace

```
php artisan app:method ModelName
```

Generate `ModelNameMethod.php` under `Models/Traits/Method` directory.

### Generate Relation

[](#generate-relation)

**Options**

- `-N|--namespace` : The namespace class. Output strategy will follow this namespace

```
php artisan app:relation ModelName
```

Generate `ModelNameRelationship.php` under `Models/Traits/Relationship` directory.

### Generate Scope

[](#generate-scope)

**Options**

- `-N|--namespace` : The namespace class. Output strategy will follow this namespace

```
php artisan app:scope ModelName
```

Generate `ModelNameScope.php` under `Models/Traits/Scope` directory.

### Generate Repository

[](#generate-repository)

**Options**

- `-d|--disable-softdelete` : Disable softdelete method (`forceDelete` and `restore`)

```
php artisan app:repository Backend/ModelName
```

Generate `ModelNameRepository.php` under `app/Repositories/Event` directory.

Output strategy
---------------

[](#output-strategy)

### Without `--namespace` option

[](#without---namespace-option)

Example files and directories output:

```
php artisan app:model ModelName
php artisan app:model AnotherModelName
```

```
app/Models
├── AnotherModelName
│   ├── AnotherModelName.php
│   └── Traits
│       ├── Attribute
│       │   └── AnotherModelNameAttribute.php
│       ├── Method
│       │   └── AnotherModelNameMethod.php
│       ├── Relationship
│       │   └── AnotherModelNameRelationship.php
│       └── Scope
│           └──AnotherModelNameScope.php
└── ModelName
    ├── ModelName.php
    └── Traits
        ├── Attribute
        │   └── ModelNameAttribute.php
        ├── Method
        │   └── ModelNameMethod.php
        ├── Relationship
        │   └── ModelNameRelationship.php
        └── Scope
            └── ModelNameScope.php

```

### With `--namespace` option

[](#with---namespace-option)

Generated combined in given namspace option. Example files and directories output:

```
php artisan app:model ModelName --namespace=Survey
php artisan app:model AnotherModelName --namespace=Survey
```

```
app/Models
└── Survey
    ├── ModelName.php
    ├── AnotherModelName.php
    └── Traits
        ├── Attribute
        │   ├── ModelNameAttribute.php
        │   └── AnotherModelNameAttribute.php
        ├── Method
        │   ├── ModelNameMethod.php
        │   └── AnotherModelNameMethod.php
        ├── Relationship
        │   ├── ModelNameRelationship.php
        │   └── AnotherModelNameRelationship.php
        └── Scope
            ├── ModelNameScope.php
            └── AnotherModelNameScope.php

```

License
-------

[](#license)

The Laravel Boilerplate Generator command is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

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

Total

18

Last Release

2141d ago

Major Versions

v0.2.0 → v1.0.02018-12-24

v0.2.1 → v1.2.02019-10-09

v0.2.2 → v1.2.12020-04-12

v1.2.1 → v2.0.02020-07-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/0df440312528d7737e222b654274174ee2065240dbf1a07df094d745cab41094?d=identicon)[hariadi](/maintainers/hariadi)

---

Top Contributors

[![hariadi](https://avatars.githubusercontent.com/u/376635?v=4)](https://github.com/hariadi "hariadi (28 commits)")

---

Tags

artisancligeneratorlaravel-5-boilerplatelaravel-boilerplatetraitconsolelaravelmodelartisancommandboilerplaterepositorytraitsrelationscopeattribute

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hariadi-laravel-boilerplate-generator/health.svg)

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

###  Alternatives

[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76125.4k1](/packages/rahul900day-laravel-console-spinner)

PHPackages © 2026

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