PHP code example of wink / wink-model-generator

1. Go to this page and download the library: Download wink/wink-model-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/ */

    

wink / wink-model-generator example snippets


return [
    /*
    |--------------------------------------------------------------------------
    | Model Namespace
    |--------------------------------------------------------------------------
    |
    | This value defines the default namespace for generated model classes.
    | You can override this on a per-model basis using the --namespace option.
    |
    | Note: Generated relationship methods currently assume that related models
    | reside in the `App\Models` namespace. If you customize `model_namespace`
    | to something else, you may need to manually adjust the namespaces in the
    | generated relationship methods.
    |
    */
    'model_namespace' => 'App\\Models',

    /*
    |--------------------------------------------------------------------------
    | Model Output Path
    |--------------------------------------------------------------------------
    |
    | This value defines the default base path for models and is used to
    | determine their PHP namespace (e.g., `App\Models` if `model_path` is
    | `app/Models`). By default, models will be placed in a
    | `GeneratedModels/{connection_name}` subdirectory within this path
    | (e.g., `app/Models/GeneratedModels/mysql`). This final output path can be
    | fully customized using the `--directory` command-line option.
    |
    */
    'model_path' => 'app/Models',

    /*
    |--------------------------------------------------------------------------
    | Factory Output Path
    |--------------------------------------------------------------------------
    |
    | This value defines the default base output path for generated factory files.
    | By default, factories will be placed in a
    | `GeneratedFactories/{connection_name}` subdirectory within this path
    | (e.g., `database/factories/GeneratedFactories/mysql`). This output path
    | can be fully customized using the `--factory-directory` command-line option.
    |
    */
    'factory_path' => 'database/factories',

    /*
    |--------------------------------------------------------------------------
    | Validation Rules
    |--------------------------------------------------------------------------
    |
    | When true, the generator will add a `public static function rules(): array`
    | method to the model class. This method contains Laravel validation rules
    | based on the column types and constraints.
    |
    */
    'generate_validation_rules' => true,
];
bash
php artisan vendor:publish --provider="Wink\ModelGenerator\ModelGeneratorServiceProvider" --tag="config"