PHPackages                             innovmt/mt-jetstream-inertia-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. [Admin Panels](/categories/admin)
4. /
5. innovmt/mt-jetstream-inertia-generator

ActiveLibrary[Admin Panels](/categories/admin)

innovmt/mt-jetstream-inertia-generator
======================================

Admin CRUD generator using Laravel Jetstream, Inertiajs, Vue.js, Pagetables and Tailwindcss. Project adapted from coolsam726/jetstream-inertia-generator

1.0.0(4y ago)013MITBladePHP ^7.4|^8.0

Since Aug 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/avinashramdoyal/MT-jetstream-inertia-generator)[ Packagist](https://packagist.org/packages/innovmt/mt-jetstream-inertia-generator)[ Docs](https://github.com/avinashramdoyal/mt-jetstream-inertia-generator)[ RSS](/packages/innovmt-mt-jetstream-inertia-generator/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

Jetstream Powered Admin CRUD Generator
======================================

[](#jetstream-powered-admin-crud-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/20b983c87a2de26867f7892d77eeba98a9ad6ee833b90f774828fe24f3218d8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736176616e6e61626974732f6a657473747265616d2d696e65727469612d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/savannabits/jetstream-inertia-generator)[![GitHub code size in bytes](https://camo.githubusercontent.com/889c85cd59f64540101e8ad8e655ce0ecd10ca348d6c7cfc2a35bb9312ec827a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f636f6f6c73616d3732362f6a657473747265616d2d696e65727469612d67656e657261746f72)](https://camo.githubusercontent.com/889c85cd59f64540101e8ad8e655ce0ecd10ca348d6c7cfc2a35bb9312ec827a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f636f6f6c73616d3732362f6a657473747265616d2d696e65727469612d67656e657261746f72)[![Travis (.com) Build](https://camo.githubusercontent.com/c7afc9419013e9553025236577926625222b63b1b83a69ec4751dedd6ed82298/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f636f6f6c73616d3732362f6a657473747265616d2d696e65727469612d67656e657261746f722f6d61737465723f6c6162656c3d7472617669732d6369)](https://travis-ci.com/github/coolsam726/jetstream-inertia-generator)[![Scrutinizer build ](https://camo.githubusercontent.com/76ba88ac96d5f7d73cfe0c7eab99ac3d0dbf4372502dd13cb87722ea1d5c6182/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f636f6f6c73616d3732362f6a657473747265616d2d696e65727469612d67656e657261746f722f6d61737465723f6c6162656c3d73637275746e697a65722d6275696c64)](https://scrutinizer-ci.com/g/coolsam726/jetstream-inertia-generator)[![Total Downloads](https://camo.githubusercontent.com/1fb4564a380592516f20785ec5e59e8b7353000796e34deacc1adb42fc4bddb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736176616e6e61626974732f6a657473747265616d2d696e65727469612d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/savannabits/jetstream-inertia-generator)

**Jetstream Inertia Generator** a.k.a **jig** allows you to generate code for simple Admin CRUDs (Create, Read, UPdate, Delete) which are fully compatible with a Laravel Project powered by the [Jetstream - Inertia - Vue.js](https://jetstream.laravel.com/2.x/stacks/inertia.html) Stack. [![](.README_images/jig-preview.gif)](.README_images/jig-preview.gif)

Scenario
--------

[](#scenario)

You are developing a NextGen project. The data model is complex. It requires **Many CRUDS** managed by the admin in order to power the main end-user functionality. You don't want to spend **Days or even Months** writing boilerplate code for all the CRUDs. If that is you, this package comes to your rescue. Just follow these simple steps:

- Generate a Migration for your CRUD table, e.g articles, and run `php artisan migrate` (About **2 minutes**)
- With this package, just run `php artisan jig:generate articles` (About **3 seconds!!!**)
- Build your css and javascript (About **27 seconds**) DONE! In about **2 and a half minutes**, you get a fully working module consisting of -:

- Model
- Admin Controller - Index, Create, Show, Edit, Store, Update, Delete
- API Controller - Index, Store, Show, Update, Delete
- An Authorization Policy - viewAny, view, create, update, delete, restore, forceDelete
- Generated Permissions for [spatie/laravel-permissions](https://spatie.be/docs/laravel-permission/v4/introduction) - articles, articles.index, articles.create, articles.show, articles.edit, articles.delete
- Frontend Menu entry
- Frontend Datatable with Actions thanks to Using Yajra Datatables and datatables.net
- Tailwindcss-powered CREATE and EDIT forms,
- Tailwindcss - powered SHOW view.
- web and API routes
- Validation and Authorization Request Classes

What more could you ask for? Cut a day's work down to less than 3 minutes.

Dependencies
------------

[](#dependencies)

If you have followed the [Jetstream - Inertia - Vue.js Installation](https://jetstream.laravel.com/2.x/stacks/inertia.html) instructions, then the project will work with minimal configuration. Other Important dependencies that you MUST configure include:

1. [Spatie Laravel Permissions](https://spatie.be/docs/laravel-permission/v4/introduction) - This is used to manage roles and permissions. Its migrations will be published during asset publishing, after which you can go ahead and configure the user trait.
2. [Laravel Sanctum](https://laravel.com/docs/8.x/sanctum) - Used to manage both API and stateful authentication. Since the whole app will be a Single Page Application, make sure you configure the middleware sanctum middleware in `app/Http/Kernel.php` as follows:

```
'api' => [
    \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
    ...
],
```

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

[](#installation)

1. You can install the package via composer:

```
composer require savannabits/jetstream-inertia-generator
```

2. Install the necessary `npm` dev dependencies by running the following command: If you are using npm:

```
npm install --include=dev --legacy-peer-deps @headlessui/vue pagetables popper.js @babel/plugin-syntax-dynamic-import dayjs dotenv numeral portal-vue postcss postcss-import pusher-js laravel-echo sass sass-loader vue3-vt-notifications vue-flatpickr-component  vue-numerals vue-pdf mitt "https://github.com/sagalbot/vue-select/tarball/feat/vue-3-compat"
```

Or if you are using yarn:

```
yarn add -D @headlessui/vue pagetables popper.js @babel/plugin-syntax-dynamic-import dayjs dotenv numeral portal-vue postcss postcss-import pusher-js laravel-echo sass sass-loader vue3-vt-notifications vue-flatpickr-component  vue-numerals vue-pdf mitt "https://github.com/sagalbot/vue-select/tarball/feat/vue-3-compat"
```

Feel free to configure the color palette to your own preference, but for uniformity be sure to include `primary`,`secondary`, `success` and `danger` variants since they are used in the jig template. 3. Publish the Package's assets, configs, templates, components and layouts. This is necessary for you to get the admin layout and all the vue components used in the generated code:

**Option 1** (Suitable for fresh installations)

```
php artisan vendor:publish --force --provider="innovmt\MTJetstreamInertiaGenerator\JetstreamInertiaGeneratorServiceProvider"
```

**Option 2** (Useful if you are upgrading the package or already have local changes you don't want to override.) NB: If you only want to update some published files, delete only the published files that you want to update, then run the appropriate command below:

```
php artisan vendor:publish --tag=jig-blade-templates #Publishes resources/views/app.blade.php. If it already exists, use --force to replace it
php artisan vendor:publish --tag=jig-config #Publishes the config file. If it exists use --force to replace it.
php artisan vendor:publish --tag=jig-routes #Publishes routes/jig.php to hold routes for generated modules.If you have already generated some routes, be sure to back them up as this file will be reset if you --force it.
php artisan vendor:publish --tag=jig-views #publishes Vue Components, app.js, bootstrap.js and Layout files. Use --force to force replace
php artisan vendor:publish --tag=jig-assets #publishes logos and other assets
php artisan vendor:publish --tag=jig-compiler-configs #publishes webpack.config.js and tailwind.config.js
php artisan vendor:publish --tag=jig-migrations #Publish database migrations
```

4. Then finish installation steps for spatie/laravel-permission by publishing its migrations.

```
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
```

NB: The `title` field will be automatically added to the `roles` and `permissions` tables when the first CRUD is generated.

5. Add the `JigMiddleware` to the Global middleware and the `web` middleware group in `app/Http/Kernel.php`:

```
protected $middleware = [
    ...,
    \innovmt\MTJetstreamInertiaGenerator\Middleware\JigMiddleware::class,
];

protected $middlewareGroups = [
    'web' => [
        ...,
        \innovmt\MTJetstreamInertiaGenerator\Middleware\JigMiddleware::class,
    ],
];
```

6. Allow First-Party access to the Sanctum API by adding the following to the `api` middleware group in `app/Http/Kernel.php`

```
protected $middlewareGroups = [
    'api' => [
        \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
        ...
    ],
];
```

7. Modify the .env to have the following keys:

```
APP_BASE_DOMAIN=mydomain.test
APP_SCHEME=http #or https
#optional mix_app_uri (The path under which the app will be served. It is recommended to run the app from the root of the domain.
MIX_APP_URI=
APP_URL=${APP_SCHEME}://${APP_BASE_DOMAIN} #If MIX_APP_URI is empty.
#APP_URL=${APP_SCHEME}://${APP_BASE_DOMAIN}/${MIX_APP_URI} #If MIX_APP_URI is not empty.

# Append the following key to your .env to allow 1st party consumption of your api:
SANCTUM_STATEFUL_DOMAINS="${APP_BASE_DOMAIN}" #You can add other comma separated domains
```

8. create the storage:link (See laravel documentation) to allow access to the public disk assets (e.g logos) via web:

```
php artisan storage:link
```

Usage
-----

[](#usage)

### The initial seeded admin user and role

[](#the-initial-seeded-admin-user-and-role)

When you run `php artisan vendor:publish --tag=jig-migrations`, a migration is published that creates an initial default user called `Administrator` and a role with the name `administrator` to enable you gain access to the system with admin privileges. The credentials for the user account are:

- Email: ****
- Password: **password**

Use these creds after migration to login and explore all parts of the application

### Create the Permissions, Roles and Users Modules first, in that order:

[](#create-the-permissions-roles-and-users-modules-first-in-that-order)

Run the following commands to generate the User Access Control Module before proceeding to generate your admin:

```
php artisan jig:generate:permission -f
php artisan jig:generate:role -f
php artisan jig:generate:user -f
```

You can now proceed to generate any other CRUD you want using the steps in the following section.

### General Steps to generate a CRUD:

[](#general-steps-to-generate-a-crud)

[![](.README_images/jig-generate.gif)](.README_images/jig-generate.gif)

1. Generate and write a migration for your table with `php artisan make:migration` command.
2. Run the migration to the database with `php artisan migrate` command
3. Generate the Whole Admin Scaffold for the module with `php artisan jig:generate` command
4. Modify and customize the generated code to suit your specific requirements if necessary. \_\_NB: If the crud already exists, and you would like to generate, you can use the `-f` or `--force` option to force replacement of files.

### Example

[](#example)

Assuming you want to generate a `books` table:

```
php artisan make:migration create_books_table
```

- Open your migration and modify it as necessary, adding your fields. After that, run the migration.

```
php artisan migrate
```

- **The Fun Part:** Scaffold a whole admin module for books with jig using the following command:

```
php artisan jig:generate books #Format: php artisan generate [table_name] [-f]
```

**NB:** To get a full list of `jig` commands called under the hood and the full description of the `jig:generate` command, you can run the following:

```
php artisan jig --help
php artisan jig:generate --help
```

The command above will generate a number of files and add routes to both your `api.php` and `web.php` route files. It will also append menu entries to the published `Menus.json` file. The generated vue files are placed under the Pages/Books folder in the js folder.

- Finally, run `yarn watch, yarn dev or yarn prod` to compile the assets. There you have your CRUD.

Roles, permissions and Sidebar Menu:
------------------------------------

[](#roles-permissions-and-sidebar-menu)

- By Default, generation of a module generates the following permissions:

    - index
    - create
    - show
    - edit
    - delete
- The naming convention for permissions is ${module-name}.${perm} e.g payments.index, users.create etc.
- This package manages access control using policies. Each generated module generates a policy with the default laravel actions:

    - viewAny, view, store, update, delete, restore, forceDelete The permissions generated above are checked in these policies. If you need to modify any of the access permissions, policies is where to look.
- Special permissions MUST also be generated to control access to the sidebar menus. These permissions SHOULD NOT contain two parts separated with a dot, but only one part.
- Menus are configured in a json file published at `./resources/js/Layouts/Jig/Menu.json`.

    - For all menu items, the json key MUST match the permision that controls that menu. A permission without any verb is generated when generating each module for this very purpose. For example, generating a `payments` module will generate a `payments` permission. Then the menu for payments must have `payments` as the json key.
    - For parent menus and any other menus which may not match any module, you have to create a permission with the key name to control its access. For example, if you have a parent menu called `master-data` you have to generate a permission with the same name.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sam Maosa](https://github.com/savannabits)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1766d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74b9d771159c128e88fc0cb0ce0cbe1e7ff4b6dcb35a1608d9c927ccc9db8ae4?d=identicon)[avinashramdoyal](/maintainers/avinashramdoyal)

---

Top Contributors

[![tplusltd](https://avatars.githubusercontent.com/u/24454113?v=4)](https://github.com/tplusltd "tplusltd (1 commits)")

---

Tags

crud-generator custom-primary-keymt-jetstream-inertia-generator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innovmt-mt-jetstream-inertia-generator/health.svg)

```
[![Health](https://phpackages.com/badges/innovmt-mt-jetstream-inertia-generator/health.svg)](https://phpackages.com/packages/innovmt-mt-jetstream-inertia-generator)
```

###  Alternatives

[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

42010.0k](/packages/venturedrake-laravel-crm)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4821.5k](/packages/erag-laravel-lang-sync-inertia)[savannabits/jetstream-inertia-generator

Admin CRUD generator using Laravel Jetstream, Inertiajs, Vue.js, Pagetables and Tailwindcss

1221.1k](/packages/savannabits-jetstream-inertia-generator)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[adminui/inertia-routes

A hybrid JS/PHP package adding Ziggy-routes functionality to your Laravel/Inertia/Vue3 application

183.3k](/packages/adminui-inertia-routes)

PHPackages © 2026

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