Download the PHP package savannabits/jetstream-inertia-generator without Composer

On this page you can find all versions of the php package savannabits/jetstream-inertia-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
savannabits/jetstream-inertia-generator
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package jetstream-inertia-generator

JIG v3.x - Jetstream Powered Admin CRUD Generator

Latest Version on Packagist GitHub code size in bytes Travis (.com) Build Scrutinizer build Total Downloads

:warning: We will maintain this repository up to Laravel 9, as we continue improving its successor, Savannabits/Acacia which is more manageable, modular and totally separate from your main application. Check it out, and please give a star if you like it. Thank you for your support!

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 Stack. Preview

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:

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

I don't like configurations, give me a working code!

No worries. If the steps below are too much, we have a starter template for near-zero setup which you can use to start your project without the initial config below. Checkout the JIG Template Here to get started. Simply click Use This Template.

Dependencies

If you have followed the Jetstream - Inertia - Vue.js Installation instructions, then the project will work with minimal configuration. Other Important dependencies that you MUST configure include:

  1. Spatie Laravel Permissions - 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 - 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:

If you are using v2.x

NB: This documentation is for v3.x of JIG. If you are using v2.x, Access v2.x Docs Here

Before You Install:

Installation

  1. You can install the package via composer:

:warning: 1. Before proceeding, ensure you have installed laravel/jetstream with inertia.

:warning: 2. Step 1 will install spatie/laravel-permission. Ensure you have published migrations for this package to create roles and permissions tables before proceeding.

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

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

Or if you are using yarn:

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.

  1. 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)

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:

  1. Add the JigMiddleware to the web middleware group in app/Http/Kernel.php:

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

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

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

  5. For v3 only, set the scripts in your package.json as follows:

  6. Enable Profile Photos by uncommenting the following line in config/jetstream.php under 'features':

  7. Run Migrations and Seeders

  8. Now build the npm dependencies using vitejs:

:rocket: You are now ready to generate your CRUDs!:tada:

Usage

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:

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:

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

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

General Steps to generate a CRUD:

  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

    Assuming you want to generate a books table:

books-crud

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:

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.

Components Documentation

Datatables

JIG is built on top of datatables.net and is fully server-side rendered using Yajra Datatables. Most of the logic resides inside App\Repositories and in the respective Repository file, there is a method called dtColumns which is used to fully control the columns shown in the Index page.

For example, in order to control the columns shown for the Users Datatable, the following is the dtColumns method under App\Repositories\Users.php:

NOTE: In order to omit the email_verified_at class from my Index columns all I had to do is comment it out (or better yet, just remove it from the list of columns!)

The datatables are also responsive by default (Checkout https://datatables.net/extensions/responsive/ for more details). For this purpose, you can use one of the following jig-provided responsive breakpoints to automatically collapse the column below a given screen size. For info on how to use the class logic, checkout the Class Logic Documentation. Most of the time I only use min-, e.g min-desktop-l

Checkout the first snippet on how I have used the responsive classes!

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of jetstream-inertia-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
doctrine/dbal Version ^3.1
laravel/framework Version >=8
inertiajs/inertia-laravel Version >=0.6
innocenzi/laravel-vite Version >=0.3
laravel/helpers Version ^1.4
laravel/jetstream Version ^2.3
spatie/laravel-permission Version ^4.2|^5
yajra/laravel-datatables Version ^1.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package savannabits/jetstream-inertia-generator contains the following files

Loading the files please wait ....