PHPackages                             skagarwal/generators - 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. skagarwal/generators

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

skagarwal/generators
====================

Directory Structure Laravel 5.1 Generator.

1.0.5(10y ago)102281MITPHP

Since May 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/SachinAgarwal1337/Laravel-5.1-Generators)[ Packagist](https://packagist.org/packages/skagarwal/generators)[ RSS](/packages/skagarwal-generators/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

This project is not maintained anymore.
=======================================

[](#this-project-is-not-maintained-anymore)

Laravel-5.1-Generators
======================

[](#laravel-51-generators)

[![Build Status](https://camo.githubusercontent.com/4f9f0dfa9bebc86e3bb7c71445d5390d8cb515629849e765a883b3f61b94b24f/68747470733a2f2f7472617669732d63692e6f72672f53616368696e4167617277616c313333372f4c61726176656c2d352e312d47656e657261746f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SachinAgarwal1337/Laravel-5.1-Generators) [![Latest Stable Version](https://camo.githubusercontent.com/ceb96fbf05b3a8ef4baaf9b6fccee5f58536b09cb7ca6609ba52021a55e7d475/68747470733a2f2f706f7365722e707567782e6f72672f736b6167617277616c2f67656e657261746f72732f762f737461626c65)](https://packagist.org/packages/skagarwal/generators) [![Latest Unstable Version](https://camo.githubusercontent.com/ab35c5a1dd32b55482138815f8c52005f72522f84e5b894da1d3bbe43afb04a7/68747470733a2f2f706f7365722e707567782e6f72672f736b6167617277616c2f67656e657261746f72732f762f756e737461626c65)](https://packagist.org/packages/skagarwal/generators) [![License](https://camo.githubusercontent.com/0699abf7815ccb5284d16ad89f6c76d6f93e771dffb5002a55b03150685ff345/68747470733a2f2f706f7365722e707567782e6f72672f736b6167617277616c2f67656e657261746f72732f6c6963656e7365)](https://packagist.org/packages/skagarwal/generators)

If you like to keep your laravel appliaction in well formed structure and tired of making all the directories and subdirectories manually for every model, Then this package will help you automate this process.

**This Package Strictly Follows The Directory Structure:**

```
app/
  |
  |_Foo/
    |
    |_Foo.php // The Eloquent Model
    |
    |_Contracts/
      |
      |_FooRepository.php // black interface
    |
    |_Events/
    |
    |_Jobs/
    |
    |_Listeners/
    |
    |_Repositories/
      |
      |_EloquentFooRepository.php // impletements the FooRepository.php interface out of the box.
```

\*\*Avaiabale Commands:\*\* - `create:model` - `create:repository` - `create:event` - `create:listener` - `create:job` *Few More to Come*

Usage
=====

[](#usage)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require skagarwal/generators --dev

```

### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

Add the `SKAgarwal\Generators\GeneratorsServiceProvider` to the `Config/app.php`'s `providers` array

```
Config/app.php

'providers' => [
  ...
  ...
  ...

  'SKAgarwal\Generators\GeneratorsServiceProvider',
],

```

### Step 3: Run Artisan!

[](#step-3-run-artisan)

You're all set. Run `php artisan` from the console, and you'll see the new commands in the `make:*` namespace section.

---

\# Commands ### `create:model`

[](#createmodel)

**Description:**

- Creates a model, migration and the directory structure.

**Arguments:**

- `model` - *Required.* Name of the model to be created.

**Options:**

- `--migration` - *Optional.* If provided, Migration for the Model will be created.

**usage:**

```
php artisan create:model Foo ---migration
```

This will produce the Following:

```
app/
  |
  |_Foo/
    |
    |_Foo.php // The Eloquent Model
    |
    |_Contracts/
      |
      |_FooRepository.php // black interface
    |
    |_Events/
    |
    |_Policies/
    |
    |_Jobs/
    |
    |_Listeners/
    |
    |_Repositories/
      |
      |_EloquentFooRepository.php // impletements the FooRepository.php interface out of the box.
```

And since `--migration` option is provided, there will be a migration for `Foo` in `Database\Migrations\`.

-

### `create:repository`

[](#createrepository)

**Description:**

- Creates a repository interface and its eloquent implimentation in respective directories.

**Arguments:**

- `model` - *Required.* The Model Name. Repository Will Be Created Under This Model Directory.

**Options:**

- `--repository` - *Optional.* The Repository Name to be created. If not provided, Repository with the Model Name will be created.

**Usage:**

```
php artisan create:repository Foo
```

This will produce:

```
app\Foo\Contracts\FooRepository.php
app\Foo\Repositories\EloquentFooRepository.php
```

If `--repository=Bar` or `-r Bar` is provided, then it will produce:

```
app\Foo\Contracts\BarRepository.php
app\Foo\Repositories\EloquentBarRepository.php
```

**Note:**

- Do not forget to bind the interface to its implimentation in Service container.
-

### `create:event`

[](#createevent)

**Description:**

- Creates a event class in `{model}/Events/` directory.

**Arguments:**

- `name` - *Required.* Name of the event class.

**Options:**

- `model` - *Required.* Name of the model the event belongs to.

**Usage:**

```
php artisan create:event UserRegistered --model=User
```

This will produce:

```
User\Events\UserRegistered.php
```

-

#### `create:listener`

[](#createlistener)

**Description:**

- Creates a event listener in `{model}\Listeners\` directory.

**Arguments:**

- `name` - *Required.* Name of the event listener.

**Options:**

- `model` - *Required.* Name of the model lsitener belongs to.
- `event` - *Required.* Name fo the event listener is being listened for.
- `queued` - *Optional* Indicated listener should be queued.

**Usage:**

```
php artisan create:listener SendWelcomeEmail --event=UserRegistered --model=User
```

This will produce:

```
User\Listeners\SendWelcomeEmail.php
```

**Note:**

- Do not forget to register the listener for the event in `EventServiceProvider`.
-

#### `create:job`

[](#createjob)

**Description:**

- Creates a job in `{model}\Jobs\` directory.

**Arguments:**

- `name` - *Required.* Name of the job.

**Options:**

- `model` - *Required.* Name of the model job belongs to.
- `queued` - *Optional* Indicated listener should be queued.

**Usage:**

```
php artisan create:job RegisterUser --model=User --queued
```

This will produce:

```
User\Jobs\RegisterUser.php
```

-

#### `create:policy`

[](#createpolicy)

**Description:**

- Creates a policy in `{model}\Policies\` directory.

**Arguments:**

- `name` - *Required.* Name of the policy.

**Options:**

- `model` - *Required.* Name of the model policy belongs to.

**Usage:**

```
php artisan create:policy PostPolicy --model=Post
```

This will produce:

```
Post\Policies\PostPolicy.php
```

-

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~0 days

Total

6

Last Release

4009d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fdc9ed9a1cff68a494c5c31b171fd86cd80600fccf312cc36458078b6edcd35?d=identicon)[Sachin Agarwal](/maintainers/Sachin%20Agarwal)

---

Top Contributors

[![SachinAgarwal1337](https://avatars.githubusercontent.com/u/5370915?v=4)](https://github.com/SachinAgarwal1337 "SachinAgarwal1337 (91 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelgeneratorsLaravel 5.1

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skagarwal-generators/health.svg)

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

###  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)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

732506.3k60](/packages/laravel-ai)[laravel/folio

Page based routing for Laravel.

608453.9k27](/packages/laravel-folio)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)

PHPackages © 2026

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