定制 pepijnolivier/eloquent-model-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pepijnolivier/eloquent-model-generator

最新稳定版本:v3.1.0

Composer 安装命令:

composer require pepijnolivier/eloquent-model-generator

包简介

Eloquent Model Generator

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This Laravel package will generate models with their appropriate Eloquent relations based on an existing database schema.

For automatically generating database migrations for your schema, see kitloong/laravel-migrations-generator

Requirements

  • PHP 8.4+
  • Laravel 12+

Installation

You can install the package via composer:

composer require --dev pepijnolivier/eloquent-model-generator

You can publish the config file with:

php artisan vendor:publish --tag="eloquent-model-generator-config"

This is the contents of the published config file:

<?php

use Illuminate\Database\Eloquent\Model;

return [
    /*
    |--------------------------------------------------------------------------
    | Namespace
    |--------------------------------------------------------------------------
    |
    | The default namespace for generated models.
    |
    */
    'model_namespace' => 'App\Models\Generated',
    'trait_namespace' => 'App\Models\Generated\Relations',

    /*
    |--------------------------------------------------------------------------
    | Output Path
    |--------------------------------------------------------------------------
    |
    | Path where the models will be created.
    |
    */
    'model_path' => 'app/Models/Generated',
    'trait_path' => 'app/Models/Generated/Relations',

    /*
    |--------------------------------------------------------------------------
    | Extend Model
    |--------------------------------------------------------------------------
    |
    | Extend the base model.
    |
    */
    'extend' => Model::class,
];

Usage

php artisan generate:models

Testing

composer test

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please see SECURITY for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 153
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 92
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 92
  • Watchers: 7
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-02