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

v7.0.1(1mo ago)25.2k1[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 today

READMEChangelog (5)Dependencies (12)Versions (28)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

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity76

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

Recently: every ~39 days

Total

26

Last Release

56d ago

Major Versions

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

v6.2.0 → v7.0.02026-04-28

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 (52 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

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M594](/packages/laravel-boost)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725173.2k14](/packages/tallstackui-tallstackui)

PHPackages © 2026

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