ahmed-aliraqi/crud-generator

This package is a useful tool to generate simple crud for laravel-modules/scaffolding

v3.3.0 2021-06-01 12:00 UTC

This package is auto-updated.

Last update: 2021-10-17 15:25:14 UTC


README

Introduction

This package is a useful tool to generate simple crud for laravel-modules/scaffolding

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

Installation

composer require ahmed-aliraqi/crud-generator --dev

Configuration

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

php artisan vendor:publish --provider="AhmedAliraqi\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