PHPackages                             denis-kisel/constructor - 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. denis-kisel/constructor

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

denis-kisel/constructor
=======================

:Ready solution for generate models with laravel-admin controllers

v2.4.6(6y ago)158MITPHP

Since Apr 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/denis-kisel/constructor-laravel)[ Packagist](https://packagist.org/packages/denis-kisel/constructor)[ Docs](https://github.com/denis-kisel/constructor-laravel)[ RSS](/packages/denis-kisel-constructor/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (5)Versions (26)Used By (0)

Constructor
===========

[](#constructor)

This is package for generate migrations with models and/or [Laravel Admin](https://github.com/z-song/laravel-admin) controllers by patterns

Dependence
----------

[](#dependence)

- For use [Laravel Admin](https://github.com/z-song/laravel-admin) controllers need to install this package
- For use [Laravel Translatable](https://github.com/dimsav/laravel-translatable) need to install this package

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

[](#installation)

Via Composer

```
$ composer require denis-kisel/constructor
```

Usage
-----

[](#usage)

### Create Model With Empty Migration

[](#create-model-with-empty-migration)

Command: `construct:model ModelName`

##### Example

[](#example)

```
$ php artisan construct:model App\\Models\\Post
```

##### Output

[](#output)

- Model: `App\Models\Post`
- Migration:

```
Schema::create('posts', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->timestamps();
});
```

### Create Model With Fields

[](#create-model-with-fields)

Command: `construct:model ModelName [options]`
Option: `{--fields=}`
Field signature: `name:type:length{extraMethod:paramValue}`
Multi fields and extra methods must separate by comma `,`

##### Example

[](#example-1)

```
$ php artisan construct:model App\\Models\\Post --fields=name:string:50,description:text{nullable},sort:integer{default:0},is_active:boolean{default:1}
```

##### Output

[](#output-1)

- Model: `App\Models\Post`
- Migration:

```
Schema::create('posts', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('name', 50);
    $table->text('description')->nullable();
    $table->integer('sort')->default(0);
    $table->boolean('is_active')->default(1);
    $table->timestamps();
});
```

### Create Model With Bind To Locale(Translation)

[](#create-model-with-bind-to-localetranslation)

See Translatable [Doc](https://github.com/dimsav/laravel-translatable)
Command: `construct:modelt ModelName [options]`
Option: `{--fields=}`
Field signature: `name:type:length{extraMethod:paramValue}[t]`Param `[t]` is optional and denotes `translation` field
Multi fields and extra methods must separate by comma `,`

##### Example

[](#example-2)

```
$ php artisan construct:modelt App\\Models\\Post --fields=name:string:50[t],description:text{nullable}[t],sort:integer{default:0},is_active:boolean{default:1}
```

##### Output

[](#output-2)

- Models: `App\Models\Post`, `App\Models\PostTranslation`
- Migrations:

```
// For Post
Schema::create('posts', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->integer('sort')->default('0');
    $table->boolean('is_active')->default('1');
    $table->timestamps();
});

// For PostTranslation
Schema::create('post_translations', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->integer('post_id')->unsigned();
    $table->string('locale')->index();
    $table->string('name', 50);
    $table->text('description')->nullable();
    $table->unique(['post_id','locale']);
    $table->timestamps();
});
```

### Create Model With Basic Page Fields

[](#create-model-with-basic-page-fields)

Command: `construct:page ModelName [options]`

##### Example

[](#example-3)

```
$ php artisan construct:page App\\Models\\Post
```

##### Output

[](#output-3)

- Model: `App\Models\Post`
- Migration:

```
Schema::create('pages', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('code')->nullable();
    $table->string('slug')->nullable();
    $table->string('name');
    $table->text('description')->nullable();
    $table->string('title')->nullable();
    $table->string('h1')->nullable();
    $table->text('keywords')->nullable();
    $table->text('meta_description')->nullable();
    $table->integer('sort')->default('0');
    $table->boolean('is_active')->default('1');
    $table->timestamps();
});
```

### Create Laravel-Admin Controller

[](#create-laravel-admin-controller)

See Laravel-Admin [Doc](https://laravel-admin.org/docs)
Command: `construct:admin ModelName {--fields=}`
Field signature: `name:type:length{extraMethod:paramValue}`
Multi fields and extra methods must separate by comma `,`

##### Example

[](#example-4)

```
$ php artisan construct:admin App\\Models\\Post --fields=name:string:50,description:text{nullable},sort:integer{default:0},is_active:boolean{default:1}
```

##### Output

[](#output-4)

- Admin Controller: `App\Admin\Controllers\PostController`
- Contains:

```
// Grid
protected function grid()
{
    $grid = new Grid(new Post);

    $grid->model()->orderBy('created_at', 'desc');

    $grid->id(__('admin.id'));
    $grid->name( __('admin.name'))->editable('text');
    $grid->description( __('admin.description'))->editable('text');
    $grid->sort( __('admin.sort'))->editable('text');
    $grid->is_active( __('admin.is_active'))->editable('select', ActiveHelper::editable());

    $grid->created_at(__('admin.created_at'));
    $grid->updated_at(__('admin.updated_at'));

    $grid->actions(function ($actions) {
        $actions->disableView();
    });

    return $grid;
}

// Form
protected function form()
{
    $form = new Form(new Post);

    $form->text('name', __('admin.name'))->required();
    $form->ckeditor('description', __('admin.description'));
    $form->number('sort', __('admin.sort'))->default('0')->required();
    $form->switch('is_active', __('admin.is_active'))->default('1')->required();

    return $form;
}
```

Options
-------

[](#options)

OptionDescription`{--fields=}`Create model with fields`{--pattern_path=}`Path to file with custom fields by pattern`{--i}`Ignore exists model or controller`{--m}`Run migration`{--a}`Create model with laravel-admin controller### Create Model With Fields

[](#create-model-with-fields-1)

Option: `{--fields=}`
Field signature: `name:type:length{extraMethod:paramValue}[t]`Param `[t]` is optional and denotes `translation` field
Multi fields and extra methods must separate by comma `,`

##### Example

[](#example-5)

```
$ php artisan construct:model App\\Models\\Post --fields=name:string:50[t],description:text{nullable}[t],sort:integer{default:0},is_active:boolean{default:1}
```

### Run Migration

[](#run-migration)

Option: `{--m}` *(migration)*

##### Example

[](#example-6)

```
$ php artisan construct:model App\\Models\\Post --fields=name:string:50 --m
```

### Overwrite Exists Model Or/And Controller

[](#overwrite-exists-model-orand-controller)

Option: `{--i}` *(ignore)*

##### Example

[](#example-7)

```
$ php artisan construct:model App\\Models\\Post --fields=name:string:50 --i
```

### Create Model With Laravel-Admin Controller

[](#create-model-with-laravel-admin-controller)

Option: `{--a}` *(admin)*

##### Example

[](#example-8)

```
$ php artisan construct:model App\\Models\\Post --fields=name:string:50 --a
```

Commands
--------

[](#commands)

CommandDescription`construct:model [options]`Create Model`construct:modelt [options]`Create Translatable Model (Bind With Locale)`construct:page [options]`Create Model With Basics Page Fields: `id`, `code`, `slug`, `name`, `description`, `title`, `h1`, `keywords`, `meta_description`, `sort`, `is_active`, `timestamps``construct:paget [options]`Create Model With Basics Page Fields(Bind With Locale). Page Fields: `id`, `sort`, `is_active`, `timestamps`. PageTranslation Fields: `code`, `slug`, `name`, `description`, `title`, `h1`, `keywords`, `meta_description``construct:admin [options]`Create Laravel Admin Controller`construct:admint [options]`Create Translatable Laravel Admin Controller(Bind With Locale)`construct:admin_page [options]`Create Laravel Admin Controller With Basics Page Fields. Basic Fields: See `construct:page``install:locale [options]`Create Locale Model With Laravel Admin Controller. Example: `$ php artisan install:locale --a --m`License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)

Contact
-------

[](#contact)

Developer: Denis Kisel

- Email:
- Skype: live:denis.kisel92

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

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

Recently: every ~3 days

Total

25

Last Release

2382d ago

Major Versions

v1.4 → 2.02019-05-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/76b9b00b6d5b5f8de8f20a5e39e9e4a6caef51a637ad8a047787a6442b9278ef?d=identicon)[denis-kisel](/maintainers/denis-kisel)

---

Top Contributors

[![den-is-ua](https://avatars.githubusercontent.com/u/235117855?v=4)](https://github.com/den-is-ua "den-is-ua (87 commits)")

---

Tags

constuctorcontrollergeneratorlaravel-adminmakermodellaravelconstructor

### Embed Badge

![Health badge](/badges/denis-kisel-constructor/health.svg)

```
[![Health](https://phpackages.com/badges/denis-kisel-constructor/health.svg)](https://phpackages.com/packages/denis-kisel-constructor)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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