foryoufeng/laravel-generator

A tool for generate Laravel code file

v3.1.1 2025-04-27 10:52 UTC

This package is auto-updated.

Last update: 2025-04-27 10:53:24 UTC


README

Laravel Generator

Total Downloads Latest Stable Version License

Laravel Generator

中文文档

A graphical interface code generator for quickly generating code for Laravel applications.

Installation

If you have PHP and Composer installed, you can install the Laravel installer via Composer:

composer require --dev foryoufeng/laravel-generator

Run the following command to install the code generator:

php artisan generator:install

Add the creator's information in the .env file:

GENERATOR_AUTHOR=Your Name

Now you can access your application URL http://localhost:8000/laravel-generator to use laravel-generator.

Configuration file

Publish configuration file

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

generator.php file description:

<?php
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')
    ]
];

Update Log

View changelog for update logs.

MIT. Please see the license file for more information.