PHP code example of macropay-solutions / php-crufd-wizard-generator

1. Go to this page and download the library: Download macropay-solutions/php-crufd-wizard-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/ */

    

macropay-solutions / php-crufd-wizard-generator example snippets


 if (InstalledVersions::isInstalled('macropay-solutions/php-kernel-dev')) {
    $app->register(\MacropaySolutions\CrufdWizardGenerator\CrufdWizardGeneratorServiceProvider::class);
}
 php run make:api-resource {resourceName} {--decorated} {--table=} {--connection=} {--composed} {--connectionAsModelFolder}

Created Model: /var/www/html/project/app/Models/Product.php
Created ModelAttributes: /var/www/html/project/app/Models/Attributes/ProductAttributes.php
Created Service: /var/www/html/project/app/Services/ProductsService.php
Created Controller: /var/www/html/project/app/Http/Controllers/ProductsController.php
Created Decorator: /var/www/html/project/app/Decorators/ProductDecorator.php
Created Middleware: /var/www/html/project/app/Http/Middleware/Decorators/ProductsMiddleware.php
---------------------------------------------------------------------------------------------
TODO:
- Fill the Model's properties and relations,
- Fill the ModelAttributes' dock-block property types,
- Fill the ModelRelations' dock-block property-reads,
- Define validations and DbCrudMap in Controller,
- Fill the Decorator,
- Register Middleware decorator as route middleware,
- Use the middleware alias as middleware in your crud route definition for each method.
- Expose resource in DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP.
---------------------------------------------------------------------------------------------
Thank you for using php-crufd-wizard-generator
For more details see: https://github.com/macropay-solutions/php-crufd-wizard-generator
For full cruFd suite: https://php-crufd-wizard.com