PHPackages                             webbtj/crud - 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. [Admin Panels](/categories/admin)
4. /
5. webbtj/crud

ActiveLibrary[Admin Panels](/categories/admin)

webbtj/crud
===========

Automatically add crud routes/methods to any model.

v0.1.1(6y ago)7442MITPHPPHP ^7.2

Since Oct 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/webbtj/crud)[ Packagist](https://packagist.org/packages/webbtj/crud)[ RSS](/packages/webbtj-crud/feed)WikiDiscussions master Synced today

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

Laravel Crud
============

[](#laravel-crud)

Laravel Crud is a package for automatically adding CRUD (Create, Read, Update, Delete) views, web controllers and API controllers for any model as rapidly as possible.

Prototyping
-----------

[](#prototyping)

Laravel Crud let's you quickly create all of the views and controllers you need for the full CRUD operation set (create, read, update, delete), including an index with just a configuration file. Laravel Crud also creates and registers routes for you automatically, giving you both web and API endpoints for your models with as little as one line in an array.

The intent of Laravel Crud is for rapid prototyping. All you need for your complete CRUD operation set is a model and corresponding database table. The properties and their types are read from the database and the appropriate UI controlls are rendered in the web UIs.

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

[](#installation)

Install via composer.

```
composer require webbtj/crud

```

Usage
-----

[](#usage)

Once installed you'll want to publish a config file to edit.

```
php artisan vendor:publish

```

When prompted, select `crud-config`. This will create `config/crud.php` where you can define the models you want crud functionality generated for.

Configuration
-------------

[](#configuration)

You can list any models you want crud functionality for in the `config/crud.php`configuration file. This file returns an array, each element in the array can be either a string naming a model, or an array with additional configuration options such as which fields are read only, excluded from certain views, and even validation. When specifying the model name, you can include the full namespace of the model (`App\Employee`) or simply the name of the class itself (`Employee`). The model name is also case-insensitive.

Example configuration file:

```
return [
    'models' => [
        // Add your model class names here (full namespace)
        // Exmaple: "App\\Employee"

        "App\\SmallChild", // a string that will create all routing and views
                           // for the model with all defaults.

        [
            'model' => "App\\FastCar", // specify the model with extra configs
            'index' => [
                'exclude' => ['created_at'], // don't show this property in the
                                             // index view
            ],
            'store' => [
                'validation' => [ // run this validation on the "store" method
                    'year' => 'required'
                ],
            ],
        ],

        [
            'model' => "App\\Employee",
            'show' => [
                'exclude' => ['sample_text', 'sample_string'],
            ],
            'edit' => [
                'exclude' => ['sample_longText'],
                'readonly' => ['sample_char'], // in the edit interface, show
                                               // this property but make it
                                               // read only
            ],
            'create' => [
                'exclude' => ['sample_text'],
                'include' => ['updated_at'], // include this property in the
                                             // create interface (it's normally
                                             // not included)
                'readonly' => ['sample_integer'],
            ],
            'index' => [
                'include' => [
                    'id', 'first_name', 'last_name', 'email', 'sample_json',
                    'sample_jsonb', 'sample_enum', 'sample_set', 'enabled'
                ],
            ],
            'update' => [
                'validation' => [
                    'first_name' => 'required',
                    'last_name' => 'required',
                ],
            ]
        ]
    ]
];

```

You can specify `include`, `exclude`, and `readonly` arrays of properties for each of the four standard views, `show`, `edit`, `create`, and `index`. You can also specify `include`, `exclude`, and `validation` arrays for each of the two standard methods, `store` and `update`. If you're specifying additional options in an array format, you must include the `model` definition as well.

Defaults
--------

[](#defaults)

While you have complete control over what fields are displayed and can be edited, there are defaults that the package will fall back to when you do not provide specifics. By default...

- no validation is applied to any properties
- `id`, `created_at`, and `updated_at` are not updateable via requests
- each view will display all properties

In all views except `index`, you will `exclude` fields you don't want displayed. If you want to customize the `index` view you will need to `include` each property.

Production
----------

[](#production)

But reading schemas for every interaction with a model, reading and parsing all of these inclusion, exclusion, read-only, and validation rules from a config, these are all pretty expensive operations and not really suited for production apps. That's why there's an artisan command to commit views and controllers to *your* codebase for better performance and further development control.

```
php artisan crud:publish

```

The `crud:publish` artisan command will create a directory for the model in your `views` directory with `index`, `show`, `create`, and `edit` views. It will also create a web controller in your `Http/Controllers` directory and an API controller in your `Http/Controllers/Api` directory. Finally it will provide recommended code for adding the routes to your `web.php` and `api.php` routes files, and recommend that you now remove the publish model(s) from your `crud.php` config file.

Of course you can customize and limit this publish with options. Provide `--model=` to speficfy the model you wish to publish. Omitting this option will publish all models. This option allows for multiple values simply by specifying it more than once (Example: `php artisan crud:publish --model=Employee --model=Car).

You can also specify which elements you want published by specifying `--type=`. Like `--model=` this can be repeated to specify multiple types to publish. The valid types are as follows:

- `controller` - publishes the web controller
- `api.controller` - publishes the API controller
- `views` - publishes all views
- `view.index` - publishes just the index view
- `view.show` - publishes just the show view
- `view.create` - publishes just the create view
- `view.edit` - publishes just the edit view

Some notes on these options. They are case insensitive; all punctuation is stripped out (so `api.controller`, `api-controller`, and `apicontroller` all work); singular vs plural doesn't matter (English only); and the order of words for the specific views doesn't matter (`view.index` or `index.view`).

Roadmap
-------

[](#roadmap)

- Unit testing
- Beta release/release to Packagist.

Contributing
------------

[](#contributing)

Contributions are always welcome [on GitHub](https://github.com/webbtj/crud). Please open issues before submitting PRs and do tag the issue in your commit messages/PR description. Also, please adhere to PSR-2 as much as possible.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity44

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

Every ~0 days

Total

2

Last Release

2384d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/834f424267af133805a9314daced3b314ddcd90796aaf3edfcae4be05d010585?d=identicon)[webbtj](/maintainers/webbtj)

---

Tags

laravelcrud

### Embed Badge

![Health badge](/badges/webbtj-crud/health.svg)

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

PHPackages © 2026

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