PHPackages                             abdelilahlbardi/laragenerator - 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. abdelilahlbardi/laragenerator

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

abdelilahlbardi/laragenerator
=============================

DRY while building your Laravel projects.

1.5(9y ago)4975326MITPHP

Since Jan 23Pushed 8y agoCompare

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

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

Laragenerator
=============

[](#laragenerator)

Laravel 5.4 generator
---------------------

[](#laravel-54-generator)

Building a laravel project comes from an idea. So why not to build the main idea behavior and leave the rest to Laragenerator in order to bootstrap your project. This package helps you to focus more about your project idea. **DRY**.

The current features help you to :

```
- Create Namespaces.
- Create Controllers.
- Create Form Requests.
- Create Models.
- Create Models Relationships.
- Create Migrations.
- Create Routes Files.
- Create Views files.

```

If you have any suggestions please let me know : .

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

[](#installation)

First, pull in the package through Composer.

```
"require": {
    "laracasts/generators": "master@dev",
    "abdelilahlbardi/laragenerator": "^1.5"
}

```

And then run :

```
composer update

```

After that, include the service provider within `config/app.php`.

```
'providers' => [
    AbdelilahLbardi\LaraGenerator\Providers\LaraGeneratorServiceProvider::class,
];

```

Usage
-----

[](#usage)

The package extends Laravel Artisan and add `generate:resource` command :

Here's a quick example of how to bootstrap your laravel idea:

```
php artisan generate:resource Backend/Article "titles:string, content:text"
```

  Name Type Exemple Usage   Model Argument Backend/Article **Required**   Schema Argument --schema="title:string, content:text, slug:string:unique" optional   Relationships Option --relations="hasmany:tags, belongsto:user" optional   Without controller Option --without-controller optional   Without model Option --without-model optional   Without request Option --without-request optional   Without views Option --without-views optional   Without routes Option --without-routes optional   Without migration Option --without-migration optional   Use flash Option --with-flash optional   Rollback Option --rollback optional Examples
--------

[](#examples)

- [Bootstrapping with all the resources](#bootstrapping-with-all-the-resources)
- [Bootstrapping without the model](#bootstrapping-without-the-model)
- [Bootstrapping with empty migration](#bootstrapping-with-empty-migration)
- [Delete the created files](#rollback)

### Bootstrapping with all the resources

[](#bootstrapping-with-all-the-resources)

```
php artisan generate:resource Article "title:string, content:text, slug:string:unique, user_id:integer:foreign"
```

You will notice additional files and folders appearing in your project :

- `Controllers/ArticlesController.php` : Here your generated controller inside the namespace that you specified.
- `app/Models/Article` : New Models folder the your Models.
- `resources/views/articles/index.blade.php` : index view which is empty.
- `resources/views/articles/create.blade.php` : empty create view.
- `resources/views/articles/edit.blade.php` : empty edit view.
- `routes/web/articles.php` : Ready routes generated.
- `database/migrations/yyyy-mm-dd-create_articles_table.php` : Here your migration.

### Bootstrapping without the model

[](#bootstrapping-without-the-model)

```
php artisan generate:resource Backed/Item "title:string, price:float, slug:string:unique, category_id:integer:foreign" --without-model
```

This will generate the same files as the recent command but will no include :

- `Controllers/Backend/ItemsController.php` : Here your generated controller inside the namespace that your specified.
- `resources/views/backend/items/index.blade.php` : index view which is empty.
- `resources/views/backend/items/create.blade.php` : empty create view.
- `resources/views/backend/items/edit.blade.php` : empty edit view.
- `routes/web/backend/items.php` : Ready routes generated.
- `database/migrations/yyyy-mm-dd-create_items_table.php` : Here your migration.

### Bootstrapping with empty migration

[](#bootstrapping-with-empty-migration)

Since `--schema` is an optional option, if you don't specify the `--schema` option, Laragenerator generates an empty model with a simple id and timestamps.

To do so, here's a simple command.

```
php artisan generate:resource Backed/Item
```

The migration file will look like:

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

class CreateItemsTable extends Migration
{
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
      Schema::create('items', function (Blueprint $table) {
          $table->increments('id');

          $table->timestamps();
      });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::drop('items');
  }
}
```

### Rollback

[](#rollback)

```
php artisan generate:resource Frontend/User --rollback
```

With the Laragenerator `--rollback` option, you don't need to delete the generated folders manually. It does all the job for you.

Notice that if you have more controllers this options doesn't delete all the controllers in the namespace.

Templates publishing
--------------------

[](#templates-publishing)

You may want to customize the templates like the following artisan command:

```
php artisan vendor:publish --tag=templates
```

This will add a new folder to your app called `Tempaltes` where you will find the following files:

- `Templates/Controller/Controller.txt` : Controllers Template.
- `Templates/Model/Model.txt` : Models Template.
- `Templates/View/index.txt` : Index View Template.
- `Templates/View/headerCell.txt` : HTML table element header row Template.
- `Templates/View/contentCell.txt` : HTML table element content rows Template.
- `Templates/View/create.txt` : Create View Template.
- `Templates/View/createInput.txt` : Create form inputs View Template.
- `Templates/View/edit.txt` : Edit View Template.
- `Templates/View/editInput.txt` : Edit form inputs View Template.
- `Templates/routes.txt`: Routes File Tempalte.

Schema
------

[](#schema)

Since Laragenerator uses  to generate migration and schema

you can find the related documentation here: .

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% 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 ~4 days

Total

6

Last Release

3421d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c03533c25bf5ee4375b6ce8c950fefc1d0403f481d95c0de7af8666e3bedba09?d=identicon)[AbdelilahLbardi](/maintainers/AbdelilahLbardi)

---

Top Contributors

[![heybardi](https://avatars.githubusercontent.com/u/24764312?v=4)](https://github.com/heybardi "heybardi (77 commits)")[![connectkushal](https://avatars.githubusercontent.com/u/19621775?v=4)](https://github.com/connectkushal "connectkushal (1 commits)")

---

Tags

generatorlaravellaravel-generatorscaffolding

### Embed Badge

![Health badge](/badges/abdelilahlbardi-laragenerator/health.svg)

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

###  Alternatives

[cerbero/enum

Zero-dependencies package to supercharge enum functionalities.

359227.5k2](/packages/cerbero-enum)[nfse-nacional/nfse-php

This is my package nfse

1533.1k](/packages/nfse-nacional-nfse-php)[yunwuxin/think-model-helper

301.2k1](/packages/yunwuxin-think-model-helper)

PHPackages © 2026

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