PHPackages                             rohinigeeks/laravel-sorcery - 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. [API Development](/categories/api)
4. /
5. rohinigeeks/laravel-sorcery

ActiveLibrary[API Development](/categories/api)

rohinigeeks/laravel-sorcery
===========================

Laravel API/Scaffold/CRUD Generator from just one command with including Controller, Repository, Model, Migrations, routes.php update.

111353PHP

Since Apr 18Pushed 11y ago2 watchersCompare

[ Source](https://github.com/rohinigeeks/Laravel-Sorcery)[ Packagist](https://packagist.org/packages/rohinigeeks/laravel-sorcery)[ RSS](/packages/rohinigeeks-laravel-sorcery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel API/Scaffold/CRUD Generator (Laravel5)
==============================================

[](#laravel-apiscaffoldcrud-generator-laravel5)

[![Total Downloads](https://camo.githubusercontent.com/9ea998c7fa8b63c4a4ce05a87d62cc68845e204aeea81da534399135a33bf95a/68747470733a2f2f706f7365722e707567782e6f72672f6d6974756c676f6c616b6979612f6c61726176656c2d6170692d67656e657261746f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/mitulgolakiya/laravel-api-generator)

Laravel Sorcery generates boilerplate code for a Laravel Web App from the MySQL Schema

This command Generator generates following things:

- Migration File
- Model
- Repository (optional)
- Controller
- View
    - index.blade.php
    - show.blade.php
    - create.blade.php
    - edit.blade.php
    - fields.blade.php
- updates routes.php

Here is the full documentation.

Steps to Get Started
--------------------

[](#steps-to-get-started)

1. Add this package to your composer.json:

    ```
     "require": {
         "rohinigeeks/laravel-sorcery": "dev-master"
     }

    ```
2. Run composer update

    ```
     composer update

    ```
3. Add the ServiceProviders to the providers array in `config/app.php`.
    As we are using these two packages [illuminate/html](https://github.com/illuminate/html) &amp; [laracasts/flash](https://github.com/laracasts/flash) as a dependency.
    so we need to add those ServiceProviders as well.

    ```
     'Illuminate\View\ViewServiceProvider',
     'Illuminate\Html\HtmlServiceProvider',
     'Laracasts\Flash\FlashServiceProvider'
     'Rohinigeeks\Generator\GeneratorServiceProvider'

    ```

Also for convenience, add these facades in alias array in `config/app.php`.

```
	'Form'  => 'Illuminate\Html\FormFacade',
	'HTML'  => 'Illuminate\Html\HtmlFacade',
	'Flash' => 'Laracasts\Flash\Flash'

```

4. Publish generator.php

    ```
     php artisan vendor:publish --provider='Rohinigeeks\Generator\GeneratorServiceProvider'

    ```
5. Fire the artisan command to generate API for Model, or to generate scaffold with views for web applications

    ```
     php artisan rohinigeeks.generator:api ModelName
     php artisan rohinigeeks.generator:scaffold ModelName

    ```

    e.g.

    ```
     php artisan rohinigeeks.generator:api Project
     php artisan rohinigeeks.generator:api Post

     php artisan rohinigeeks.generator:scaffold Project
     php artisan rohinigeeks.generator:scaffold Post

    ```
6. And You are ready to go. :)

Documentation
-------------

[](#documentation)

### Generator Config file

[](#generator-config-file)

Config file (`config/generator.php`) contains path for all generated files

`path_migration` - Path where Migration file to ge generated
`path_model` - Path where Model file to ge generated
`path_repository` - Path where Repository file to ge generated
`path_controller` - Path where Controller file to ge generated
`path_views` - Path where views will be created
`path_request` - Path where request file will be created
`path_routes` - Path of routes.php (if you are using any custom routes file)

`namespace_model` - Namespace of Model
`namespace_repository` - Namespace of Repository
`namespace_controller` - Namespace of Controller
`namespace_request` - Namespace for Request

### Field Input

[](#field-input)

Here is the input for the fields by which you can specify Input.

```
    fieldName:fieldType,options:fieldOptions

```

e.g.,

```
    email:string:unique
    email:string:unique,default('me@mitul.me')
    title:string,100
    price:flat,8,4

```

Parameters will be in the same sequence as `Blueprint` class function for all types. Option will be printed as it is given in input except unique &amp; primary.

### API Response Structure

[](#api-response-structure)

**Remember: This response structure is based on the most of my API response structure, you can change it to your API response after file generation in controller.**

**Success**

```
    {
        "flag":true,
        "message":"success message",
        "data":{}
    }

```

data can be anything as per response.

**Failure**

```
    {
        "flag":false,
        "message":"failure message",
        "code": 0
        "data":{}
    }

```

data will be optional. And code will be error code.

### Generated Views

[](#generated-views)

While generating scaffold, all views are created with basic CRUD functionality. (**currently delete is not working**)

Views will be created in `resources/views/modelName` folder,

```
    index.blade.php - Main Index file for listing records
    create.blade.php - To insert a new record
    edit.blade.php - To edit a record
    fields.blade.php - Common file of all model fields, which will be used create and edit record
    show.blade.php - To display a record

```

Credits
-------

[](#credits)

This API Generator was forked from laravel-api-generator created by

1. [Jamison Valenta](https://github.com/jamisonvalenta)
2. [Mitul Golakiya](https://github.com/mitulgolakiya).
3. \[Bernhard Breytenbach\] ()

Screenshots
-----------

[](#screenshots)

### Command Execution

[](#command-execution)

!\[Image of Command Execution\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RbTRvTEswQ0tfOEU](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RbTRvTEswQ0tfOEU))

### Generated Files &amp; routes.php

[](#generated-files--routesphp)

!\[Image of Generated Files\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RZ1VMcXlsM1Z2MDg](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RZ1VMcXlsM1Z2MDg))

### Migration File

[](#migration-file)

!\[Image of Migration File\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RMWtnN1RxUzdmTUE](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RMWtnN1RxUzdmTUE))

### Model File

[](#model-file)

!\[Image of Model File\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RRUJfdHE4MVRaeXM](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RRUJfdHE4MVRaeXM))

### Repository File

[](#repository-file)

!\[Image of Repository File\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7ROUdNVTVORm5nQ1E](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7ROUdNVTVORm5nQ1E))

### Controller File

[](#controller-file)

!\[Image of Controller File\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RREVacVlOZDhxNDQ](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RREVacVlOZDhxNDQ))

### View Files

[](#view-files)

!\[Image of View Files\] ([http://drive.google.com/uc?export=view&amp;id=0B5kWGBdVjC7RQW5FOXExOFhEbms](http://drive.google.com/uc?export=view&id=0B5kWGBdVjC7RQW5FOXExOFhEbms))

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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.

### Community

Maintainers

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

---

Top Contributors

[![mitulgolakiya](https://avatars.githubusercontent.com/u/1908535?v=4)](https://github.com/mitulgolakiya "mitulgolakiya (36 commits)")[![rohinigeeks](https://avatars.githubusercontent.com/u/312715?v=4)](https://github.com/rohinigeeks "rohinigeeks (2 commits)")[![jampot5000](https://avatars.githubusercontent.com/u/932691?v=4)](https://github.com/jampot5000 "jampot5000 (1 commits)")

### Embed Badge

![Health badge](/badges/rohinigeeks-laravel-sorcery/health.svg)

```
[![Health](https://phpackages.com/badges/rohinigeeks-laravel-sorcery/health.svg)](https://phpackages.com/packages/rohinigeeks-laravel-sorcery)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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