kamalsroor/crud-generator

This package is a useful tool to generate simple crud for Kamalsroor/scaffoldingNew

1.0.8 2021-11-22 14:31 UTC

This package is auto-updated.

Last update: 2024-05-16 01:29:07 UTC


README

Introduction

This package is a useful tool to generate simple crud for Kamalsroor/scaffoldingNew

the files that will be generated is:

  • Lang Files (ar & en)
  • Breadcrumb File
  • View Files
  • Api Resource Files
  • Migration Files
  • Factory File
  • Policy Files
  • Controller Files
  • Model Files
  • Request Files
  • Filter Files
  • Test Files
  • Excel Import Export
  • Soft Delete
  • Swagger Api

Installation

composer require kamalsroor/crud-generator --dev

Configuration

You should add config file using the following command to configure the supported resources.

php artisan vendor:publish --provider="KamalSroor\CrudGenerator\CrudServiceProvider"

Then add the following comment line in the routes/dashboard.php and routes/api.php files:

/*  The routes of generated crud will set here: Don't remove this line  */

And the follwing comment line in the resources/views/layouts/sidebar.blade.php file:

{{-- The sidebar of generated crud will set here: Don't remove this line --}}

Usage

For example if you want to generate a new CRUD named category. make sure it's arabic words was defined in arabicWords of config file and then use the following artisan command:

php artisan make:crud category

Use translatable option if the CRUD is translatable:

php artisan make:crud category --translatable

Use has-media option if the CRUD has media:

php artisan make:crud category --has-media

Also you can use both options together to generate translatable and has media CRUD.

php artisan make:crud category --translatable --has-media