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

ActiveLibrary[Admin Panels](/categories/admin)

nabila/crud-generator
=====================

A Laravel package to generate full CRUD modules with advanced features

v1.0.0(6mo ago)11MITPHPPHP &gt;=8.1CI failing

Since Oct 12Pushed 6mo agoCompare

[ Source](https://github.com/Nabilaahmed2000/crud-generator)[ Packagist](https://packagist.org/packages/nabila/crud-generator)[ RSS](/packages/nabila-crud-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel CRUD Generator
======================

[](#laravel-crud-generator)

[![CI](https://github.com/Nabilaahmed2000/crud-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/Nabilaahmed2000/crud-generator/actions)[![Packagist Version](https://camo.githubusercontent.com/d4466dec2c7a67794e6fd31005cc9e5610c0aba13407f86002af8972daca3713/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6162696c612f637275642d67656e657261746f722e737667)](https://packagist.org/packages/nabila/crud-generator)

A Laravel package that generates complete CRUD modules with optional media library, translatable fields, relationships, and API resources.

Features
--------

[](#features)

- ✅ **Complete CRUD Generation**: Models, Migrations, Controllers, Requests, Views, Routes
- ✅ **API Support**: Generate API controllers and resources instead of web interfaces
- ✅ **Media Library**: Integration with Spatie Media Library for file uploads
- ✅ **Translatable Fields**: Support for Spatie Translatable package
- ✅ **Relationships**: Automatic relationship generation
- ✅ **Form Validation**: Automatic request validation classes
- ✅ **Bootstrap Views**: Ready-to-use Bootstrap-styled views
- ✅ **Customizable**: Publishable stubs and configuration

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

[](#installation)

Install the package via Composer:

```
composer require nabila/crud-generator
```

The package will automatically register its service provider.

### Optional Dependencies

[](#optional-dependencies)

For additional features, install these packages:

```
# For media library support
composer require spatie/laravel-medialibrary

# For translatable models
composer require spatie/laravel-translatable
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Generate a complete CRUD module:

```
php artisan crud:make Post --fields="title:string,content:text,published:boolean"
```

This generates:

- `app/Models/Post.php`
- `database/migrations/create_posts_table.php`
- `app/Http/Controllers/PostController.php`
- `app/Http/Requests/Post/StorePostRequest.php`
- `app/Http/Requests/Post/UpdatePostRequest.php`
- `resources/views/posts/` (index, create, edit, show)
- Route definitions in `routes/web_generated.php`

### Advanced Features

[](#advanced-features)

#### With Media Library Support

[](#with-media-library-support)

```
php artisan crud:make Product --fields="name:string,description:text,image:file,price:integer" --with-media
```

#### Translatable Fields

[](#translatable-fields)

```
php artisan crud:make Article --fields="title:string,content:text,slug:string" --translatable
```

#### With Relationships

[](#with-relationships)

```
php artisan crud:make Post --fields="title:string,content:text" --relationships="belongsTo:User,hasMany:Comment"
```

#### API Generation

[](#api-generation)

```
php artisan crud:make Product --fields="name:string,price:integer" --api
```

This generates API controllers and resources instead of web views.

#### Complex Example

[](#complex-example)

```
php artisan crud:make BlogPost --fields="title:string,slug:string,content:text,excerpt:text:nullable,featured_image:file,published:boolean,published_at:date:nullable" --with-media --translatable --relationships="belongsTo:User,belongsTo:Category,hasMany:Comment" --force
```

### Available Field Types

[](#available-field-types)

- `string` - VARCHAR field
- `text` - TEXT field
- `integer` - INTEGER field
- `boolean` - BOOLEAN field
- `date` - DATE field
- `email` - VARCHAR with email validation
- `file` - File upload field (works with --with-media)

Add `:nullable` to make fields optional:

```
--fields="name:string,description:text:nullable,age:integer:nullable"
```

### Command Options

[](#command-options)

OptionDescription`--fields`**Required.** Comma-separated fields with types`--with-media`Include Spatie Media Library support`--translatable`Make model translatable`--relationships`Add relationships (belongsTo:Model,hasMany:Model)`--api`Generate API routes and controller`--force`Overwrite existing files### List Available Commands

[](#list-available-commands)

```
php artisan crud:list
```

Generated Files Structure
-------------------------

[](#generated-files-structure)

### For Web CRUD:

[](#for-web-crud)

```
app/
├── Models/Post.php
└── Http/
    ├── Controllers/PostController.php
    └── Requests/Post/
        ├── StorePostRequest.php
        └── UpdatePostRequest.php

database/migrations/
└── 2024_01_01_000000_create_posts_table.php

resources/views/posts/
├── index.blade.php
├── create.blade.php
├── edit.blade.php
└── show.blade.php

routes/
└── web_generated.php

```

### For API CRUD:

[](#for-api-crud)

```
app/
├── Models/Post.php
└── Http/
    ├── Controllers/Api/PostController.php
    ├── Resources/PostResource.php
    └── Requests/Post/
        ├── StorePostRequest.php
        └── UpdatePostRequest.php

routes/
└── api_generated.php

```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=nabila-crud-config
```

Publish the stubs for customization:

```
php artisan vendor:publish --tag=nabila-crud-stubs
```

Customization
-------------

[](#customization)

After publishing stubs, you can customize the templates in `stubs/nabila-crud/`. The generator will use your custom stubs if they exist.

### Available Stubs

[](#available-stubs)

- `model.stub` - Model template
- `migration.stub` - Migration template
- `controller.stub` - Web controller template
- `api-controller.stub` - API controller template
- `store-request.stub` - Store request validation
- `update-request.stub` - Update request validation
- `resource.stub` - API resource template
- `views/index.blade.stub` - Index view template
- `views/create.blade.stub` - Create view template
- `views/edit.blade.stub` - Edit view template
- `views/show.blade.stub` - Show view template
- `routes.stub` - Web routes template
- `api-routes.stub` - API routes template

Integration
-----------

[](#integration)

### Register Generated Routes

[](#register-generated-routes)

Add to your `routes/web.php`:

```
if (file_exists(__DIR__ . '/web_generated.php')) {
    require __DIR__ . '/web_generated.php';
}
```

Add to your `routes/api.php`:

```
if (file_exists(__DIR__ . '/api_generated.php')) {
    require __DIR__ . '/api_generated.php';
}
```

### Run Migrations

[](#run-migrations)

After generating your CRUD:

```
php artisan migrate
```

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

[](#requirements)

- PHP 8.1+
- Laravel 10.0+, 11.x or 12.x

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

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

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Nabila](mailto:nabilaahmed2022@gmail.com)
- [All Contributors](../../contributors)

Support
-------

[](#support)

If you discover any security related issues, please email  instead of using the issue tracker.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance69

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

209d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/615a78700612f836c91c6267923494ae945f976fc5573468144ce6004db4699f?d=identicon)[nabila\_ahmed](/maintainers/nabila_ahmed)

---

Top Contributors

[![Nabilaahmed2000](https://avatars.githubusercontent.com/u/55749921?v=4)](https://github.com/Nabilaahmed2000 "Nabilaahmed2000 (2 commits)")

---

Tags

laravelpackagegeneratorartisancrud

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[brackets/admin-generator

Laravel 8 CRUD generator for brackets/craftable

50190.9k](/packages/brackets-admin-generator)

PHPackages © 2026

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