PHP code example of foryoufeng / laravel-generator

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

    

foryoufeng / laravel-generator example snippets



return [
    'name' => 'Laravel Generator',
    // the url to access
    'route'=>'laravel-generator',
    // Define rules
    'rules' => [
        'string',
        'email',
        'file',
        'numeric',
        'array',
        'alpha',
        'alpha_dash',
        'alpha_num',
        'date',
        'boolean',
        'distinct',
        'phone',
        'custom'
    ],
    // Set labels
    'tags' => [
        [
            'name' => 'Controller',
            'path' => 'app/Http/Controllers/Admin/',
            'file' => 'DummyClassController.php',
            'type' => 'primary',
        ],
        [
            'name' => 'Test',
            'path' => 'tests/Unit',
            'file' => 'DummyClassTest.php',
            'type' => 'danger',
        ],
        [
            'name' => 'Vue',
            'path' => 'resources/views/admin/DummySnakeClass/',
            'file' => 'index.vue',
            'type' => 'warning',
        ],
        [
            'name' => 'Request',
            'path' => 'app/Http/Requests/',
            'file' => 'DummyClassRequest.php',
            'type' => 'success',
        ]
    ],
    // Custom parameters
    'customDummys' => [
        'DummyAuthor'=>env('GENERATOR_AUTHOR','system')
    ]
];

php artisan generator:install
sh
php artisan vendor:publish --tag=laravel-generator