PHPackages                             shibuyakosuke/laravel-crud-command - 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. shibuyakosuke/laravel-crud-command

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

shibuyakosuke/laravel-crud-command
==================================

Generate CRUD files for laravel.

1.0.0(5y ago)35241MITPHPPHP ^7.2.5 | ^7.3 | ^7.4

Since Oct 29Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ShibuyaKosuke/laravel-crud-command)[ Packagist](https://packagist.org/packages/shibuyakosuke/laravel-crud-command)[ RSS](/packages/shibuyakosuke-laravel-crud-command/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (3)Used By (0)

laravel-crud-command
====================

[](#laravel-crud-command)

[日本語](README.ja.md)

Get the schema from the pre-created database and use the artisan command to batch output the files needed for CRUD.

Feature
-------

[](#feature)

1. Generate a file for translation from MySQL table comment and column comment.
    - resourcees/lang/{locale}/tables.php
    - resourcees/lang/{locale}/columns.php
2. Create validation rule from MySQL table definition.
    - rules/{model}.php
3. Model creation
    - A property is automatically generated from the table column.
    - Output **belongsTo, hasMany, belongsToMany methods** from the foreign key constraint.
4. Controller creation
    - Output all methods required for CRUD.
5. Global scope creation
    - Create one global scope class for each model.
6. Form request class creation
    - The rules are automatically output from the table definition.
7. View composer creation
    - Automatically generate the logic that passes the form part to the view from the foreign key definition.
8. View creation
    - Lists, details, new creations and updates are automatically generated.
9. Bread crumb list creation
    - A breadcrumb trail is automatically output to the file generated by CRUD.
10. Template customization
    - Depending on the project, you may need to customize the output template. In that case, you can edit the stub as you like.

Install
-------

[](#install)

```
composer require shibuyakosuke/laravel-crud-command
```

Setup
-----

[](#setup)

##### 1. First and foremost, start by creating a migration file. Be sure to set the comment and foreign key as shown in the example.

[](#1-first-and-foremost-start-by-creating-a-migration-file-be-sure-to-set-the-comment-and-foreign-key-as-shown-in-the-example)

- Be sure to add a table comment to the table that generates the model.
- Do not comment on many-to-many intermediate tables.

For the table comment function, [diplodocker/comments-loader](https://github.com/diplodocker/comments-loader) is used.

```
use Illuminate\Database\Schema\Blueprint;

Schema::create('users', function (Blueprint $table) {
    $table->id()->comment('ID');
    $table->unsignedBigInteger('role_id')->nullable()->comment('ロールID');
    $table->unsignedBigInteger('company_id')->nullable()->comment('会社ID');
    $table->string('name')->comment('氏名');
    $table->string('email')->unique()->comment('メールアドレス');
    $table->timestamp('email_verified_at')->nullable()->comment('メール認証日時');
    $table->string('password')->comment('パスワード');
    $table->rememberToken()->comment('リメンバートークン');
    $table->timestamp('created_at')->nullable()->comment('作成日時');
    $table->timestamp('updated_at')->nullable()->comment('更新日時');
    $table->softDeletes()->comment('削除日時');

    $table->tableComment('ユーザー'); // Table comment helps you to make language files.

    // Foreign key helps you to make belongsTo methods, hasMany methods and views .
    $table->foreign('role_id')->references('id')->on('roles');
    $table->foreign('company_id')->references('id')->on('companies');
});
```

##### 2. Execute migration

[](#2-execute-migration)

```
php artisan migrate
```

##### 3. Edit config/app.php to set language

[](#3-edit-configappphp-to-set-language)

```
'locale' => 'ja',

```

##### 4. Output resource

[](#4-output-resource)

```
php artisan crud:setup
```

##### 5. Output all CRUD files

[](#5-output-all-crud-files)

```
php artisan make:crud users
```

###### Option

[](#option)

- `--force`
    Even if the file exists, it is overwritten and output.
- `--api`
    Outputs only the REST controller, not the normal controller.
- `--with-api`
    Output normal controller and controller for REST. It cannot be specified at the same time as `--api`.
- `--sortable`
    The table sorting function is output.
- `--with-export`
    The table export function is output.
- `--with-filter`
    The table filter function is output together.
- `--with-trashed`
    The table export function is output.

Other commands
--------------

[](#other-commands)

To customize the output file, execute the following command to output multiple product files with the extension .stub in the /stubs directory. Customize the output file.

```
php artisan stub:publish
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2022d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7816825?v=4)[Kosuke Shibuya](/maintainers/ShibuyaKosuke)[@ShibuyaKosuke](https://github.com/ShibuyaKosuke)

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shibuyakosuke-laravel-crud-command/health.svg)

```
[![Health](https://phpackages.com/badges/shibuyakosuke-laravel-crud-command/health.svg)](https://phpackages.com/packages/shibuyakosuke-laravel-crud-command)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[ronasit/laravel-helpers

Provided helpers function and some helper class.

1475.7k13](/packages/ronasit-laravel-helpers)

PHPackages © 2026

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