PHPackages                             ahmed-aliraqi/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ahmed-aliraqi/crud-generator

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

ahmed-aliraqi/crud-generator
============================

This package is a useful tool to generate simple crud for laravel-modules/scaffolding

v6.2.0(1mo ago)25.1k1[1 issues](https://github.com/ahmed-aliraqi/crud-generator/issues)1MITPHPPHP &gt;=8.2

Since Jan 29Pushed 1mo ago2 watchersCompare

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

READMEChangelog (5)Dependencies (8)Versions (26)Used By (1)

CRUD. Generator
===============

[](#crud-generator)

### Introduction

[](#introduction)

**This package is a useful tool to generate simple crud for [laravel-modules/scaffolding](https://github.com/laravel-modules/scaffolding)**

the files that will be generated is:

- Lang Files (ar &amp; en)
- Breadcrumb File
- View Files
- Api Resource Files
- Migration Files
- Factory File
- Policy Files
- Controller Files
- Model Files
- Request Files
- Filter Files
- Test Files

### Installation

[](#installation)

```
composer require ahmed-aliraqi/crud-generator --dev
```

### Configuration

[](#configuration)

You should add config file using the following command to configure the supported resources.

```
php artisan vendor:publish --provider="AhmedAliraqi\CrudGenerator\CrudServiceProvider"
```

Then add the following comment line in the `routes/dashboard.php` and `routes/api.php` files:

```
/*  The routes of generated crud will set here: Don't remove this line  */
```

And the follwing comment line in the `resources/views/layouts/sidebar.blade.php` file:

```
{{-- The sidebar of generated crud will set here: Don't remove this line --}}
```

### Usage

[](#usage)

For example if you want to generate a new CRUD named `category`. make sure it's arabic words was defined in `arabicWords` of config file and then use the following `artisan` command:

```
php artisan make:crud category
```

Use `translatable` option if the CRUD is translatable:

```
php artisan make:crud category --translatable
```

Use `has-media` option if the CRUD has media:

```
php artisan make:crud category --has-media
```

Also you can use both options together to generate translatable and has media CRUD.

```
php artisan make:crud category --translatable --has-media
```

### Account Type Cloner

[](#account-type-cloner)

```
php artisan account:clone customer merchant
```

> This command will clone `customer` account type to another type named `merchant`,

Some files should be modified manually like:

- add constant for the newly generated type in `app/Models/User.php`

```
/**
 * The code of merchant type.
 *
 * @var string
 */
const MERCHANT_TYPE = 'merchant';
```

Then register the type in `childTypes` array:

```
/**
 * @var array
 */
protected $childTypes = [
    // other types ...
    self::MERCHANT_TYPE => Merchant::class,
];
```

- Add check for type helper in `app/Models/Helpers/UserHelper.php`:

```
/**
 * Determine whether the user type is merchant.
 *
 * @return bool
 */
public function isMerchant()
{
    return $this->type == User::MERCHANT_TYPE;
}
```

- Add seeders in `database/seeders/UserSeeder.php`:

```
Merchant::factory()->count(10)->create();
```

- Add translation lang file name to `config/lang-generator.php`

```
    'lang' => [
        // ...
        'merchants' => base_path('lang/{lang}/merchants.php'),
        /*  The lang of generated crud will set here: Don't remove this line  */
    ],
```

- Update arabic translations in lang file for generated type `lang/ar/merchants.php`
- Add type translated key into `lang/{lang}/users.php`:

```
'types' => [
    // Other types ...
    'merchant' => 'Merchant',
],
```

- Clone view files in dashboard from `customer` directory to `merchant` and replace all `customer` word to `merchant`
    - `Customer` =&gt; `Merchant`
    - `customers` =&gt; `merchants`
    - `customer` =&gt; `merchant`
- Add Sidebar link in `resources/views/dashboard/accounts/sidebar.blade.php`:

```
[
    'name' => trans('merchants.plural'),
    'url' => route('dashboard.merchants.index'),
    'can' => ['ability' => 'viewAny', 'model' => \App\Models\Merchant::class],
    'active' => request()->routeIs('*merchants*'),
],
```

- Add the routes for the newly generated type in `routes/dashboard.php` file:

```
// Merchants Routes.
Route::get('trashed/merchants', 'MerchantController@trashed')->name('merchants.trashed');
Route::get('trashed/merchants/{trashed_merchant}', 'MerchantController@showTrashed')->name('merchants.trashed.show');
Route::post('merchants/{trashed_merchant}/restore', 'MerchantController@restore')->name('merchants.restore');
Route::delete('merchants/{trashed_merchant}/forceDelete', 'MerchantController@forceDelete')->name('merchants.forceDelete');
Route::resource('merchants', 'MerchantController');
```

- Add route binding in `storage/soft_deletes_route_binding.json`:

```
{
 "trashed_merchant": "App\\Models\\Merchant"
}
```

- Add the permision in `storage/permissions.json`:

```
[
    "manage.merchants"
]
```

- Add `actingAsMerchant` helper into `tests/TestCase.php`

```
  /**
   * Set the currently logged in merchant for the application.
   *
   * @param null $driver
   * @return \App\Models\Merchant
   */
  public function actingAsMerchant($driver = null)
  {
      $merchant = Merchant::factory()->create();

      $this->be($merchant, $driver);

      return $merchant;
  }
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance79

Regular maintenance activity

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity75

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

Recently: every ~28 days

Total

24

Last Release

55d ago

Major Versions

v1.0.1 → v2.0.02021-03-07

v2.0.0 → v3.0.02021-03-10

v3.3.0 → v4.0.02022-02-12

v4.1.0 → v5.0.02025-07-13

v5.0.2 → v6.0.02025-12-02

PHP version history (5 changes)v1.0.0PHP ^7.4

v3.2.3PHP ^7.4|~8.0

v4.0.0PHP ^8.0.2

v4.1.0PHP &gt;=8.0

v6.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23261109?v=4)[Ahmed Fathy](/maintainers/ahmed-aliraqi)[@ahmed-aliraqi](https://github.com/ahmed-aliraqi)

---

Top Contributors

[![ahmed-aliraqi](https://avatars.githubusercontent.com/u/23261109?v=4)](https://github.com/ahmed-aliraqi "ahmed-aliraqi (50 commits)")

### Embed Badge

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

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

###  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)[livewire/flux

The official UI component library for Livewire.

9475.0M86](/packages/livewire-flux)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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