PHP code example of sajidul-islam / laravel-crud-generator

1. Go to this page and download the library: Download sajidul-islam/laravel-crud-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sajidul-islam / laravel-crud-generator example snippets


use SajidUlIslam\CrudGenerator\Services\CrudGeneratorService;

$data = [
    'model_name'     => 'Book',
    'table_name'     => 'books',
    'with_migration' => true,
    'with_seeder'    => false,
    'fields' => [
        [
            'name'       => 'title',
            'type'       => 'string',
            'validation' => '

  $fieldTypes = [
      'string'   => 'String',
      'text'     => 'Text',
      'integer'  => 'Integer',
      'boolean'  => 'Boolean',
      'date'     => 'Date',
      'datetime' => 'DateTime',
      'email'    => 'Email',
      'password' => 'Password',
  ];

  return view('vendor.crud-generator.index', compact('fieldTypes'));
  
bash
   php artisan migrate
   
bash
php artisan vendor:publish --provider="SajidUlIslam\CrudGenerator\CrudGeneratorServiceProvider"
bash
php artisan crud:generate Book
bash
php artisan crud:generate Post
bash
php artisan crud:generate Product --table=products_catalog
bash
php artisan crud:generate Category --no-migration
bash
php artisan crud:generate User --with-seeder