PHP Classes

File: src/config/crud.php

Recommend this page to a friend!
  Classes of TJ Webb   Laravel CRUD Generator   src/config/crud.php   Download  
File: src/config/crud.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Laravel CRUD Generator
Generate MVC classes for any Laravel model
Author: By
Last change:
Date: 4 years ago
Size: 1,951 bytes
 

Contents

Class file image Download
<?php

return [
   
'models' => [
       
// Add your model class names here (full namespace)
        // Exmaple: "App\\Employee"

        // Add a multi dimentional array to configure excluded, readonly,
        // included fields on standard views as well as validation.

            /* Example:
            [
                'model' => "App\\Employee",
                'show' => [
                    'exclude' => ['field_name'],
                ],
                'edit' => [
                    'exclude' => ['field_name'],
                    'readonly' => ['field_name'],
                ],
                'create' => [
                    'exclude' => ['field_name'],
                    'include' => ['updated_at'],
                    'readonly' => ['field_name'],
                ],
                'index' => [
                    'include' => ['id', 'first_name', 'last_name', 'email', 'enabled'],
                ],
                'update' => [
                    'validation' => [
                        'first_name' => 'required',
                        'last_name' => 'required',
                    ],
                ],
                'store' => [
                    'validation' => [
                        'first_name' => 'required',
                        'last_name' => 'required',
                    ],
                ]
                'middleware' => [
                    'web' => ['customWebMiddleware'],
                    'api' => ['customApiMiddleware']
                ]
            ]
            */

       // Certain fields (id, created_at, updated_at) are automatically
       // readonly / removed from forms. These can be overridden by including
       // them in "include".
       // If "include" is populated with anything other than these three fields
       // only fields in "include" will be displayed. This does not apply to
       // "index". "index" only displays fields in "include".
   
]
];