shadowbane/mysqltomodel

此包已被弃用且不再维护。未建议替代包。

从 MySQL 数据库创建简单模型

0.1.0 2016-10-11 10:07 UTC

This package is not auto-updated.

Last update: 2022-04-07 04:38:36 UTC


README

构建状态 总下载量 为 Laravel 构建 最新稳定版本 最新不稳定版本 #MySQL To Model 从 MySQL / MariaDB 数据库创建简单模型。此包帮助您从现有的数据库表和列创建模型

###功能

  • 指定要使用的连接和数据库
  • 设置生成模型的命名空间
  • 指定在迁移时表中是否有时间戳

###安装

composer require --dev shadowbane/mysqltomodel

然后,将以下行添加到 config/app.php

Shadowbane\MySQLModel\MySQLModelServiceProvider::class,

###运行

php artisan mysqltomodel:make --help
Usage:
  mysqltomodel:make [options] [--] <connection> <database>

Arguments:
  connection                   The Connection defined in config/database.php
  database                     Database Name

Options:
      --namespace[=NAMESPACE]  Namespace to use. Defaulted using Connection Name
  -T, --timestamps             Whether the generated model should use timestamp
  -h, --help                   Display this help message
  -q, --quiet                  Do not output any message
  -V, --version                Display this application version
      --ansi                   Force ANSI output
      --no-ansi                Disable ANSI output
  -n, --no-interaction         Do not ask any interactive question
      --env[=ENV]              The environment the command should run under.
  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Generate Models from existing databases

###作者 Adly Shadowbane ###许可证 此项目采用 GNU 通用公共许可证 v3.0