在Laravel中进行逆向工程还是实体的自动生成? [英] Reverse engineering or Auto-Generations of Entities in Laravel?

查看:130
本文介绍了在Laravel中进行逆向工程还是实体的自动生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常使用SF2和Doctrine,可以自动生成实体,如果您在像MySQL Workbench这样的Soft中构建架构,则可以进行逆向工程.

I usually work with SF2, and with Doctrine, Entities can be generated automatically and if you build the schema in a Soft like MySQL Workbench you can do Reverse Engineering.

我是Laravel的新手,所以有办法做到这两件事吗?我会使用Laravel,因为我需要做一个非常小的项目,但是我不想为我们所谓的迁移"编写所有这些代码,似乎很无聊吗?

I'm new to Laravel so there is a way to do these both things? I would use Laravel because I've to do a very little project, but I didn't want to write all this code for what we call "Migrations", seems very boring no?

那么有一种方法可以在laravel中生成这些东西吗?也许我必须为此使用Laravel中的Doctrine?

So there is a way to generate this stuff in laravel? Maybe I've to use Doctrine in Laravel for that?

推荐答案

如果要从现有的mysql数据库生成迁移文件,可以使用名为XCMer/larry-four-generator的Laravel软件包.除了逆向工程外,它还有很多其他功能.

If you want to generate migration files from an existing mysql database you can use a Laravel package called XCMer / larry-four-generator. Apart from reverse engineering it has a bunch of other features.

Larry Four是Laravel 4软件包,提供高级模型和 迁移生成功能.多亏了Larry,您可以快速 在简单的DSL中记下您的想法的数据方案,并慷慨地 只需单击一下,即可从中进行迁移和建模.拉里还可以 分析您现有的数据方案,并为您带来一些魔力.

Larry Four is a Laravel 4 package offering advanced model and migration generation functionality. Thanks to Larry you can quickly jot down the data scheme for your idea in an easy DSL and genereate migrations and models from it with just a single click. Larry can also analyse your existing data scheme and generate some magic for you too.

尝试最好的原始master分支
https://github.com/XCMer/larry-four-generator/tree/master

Try the original best master branch
https://github.com/XCMer/larry-four-generator/tree/master

或提供其他功能的我的扩展模型前叉
https://github.com/XCMer/larry-four-generator/tree /Gadoma扩展模型

or my Extended Models fork offering additional functionality
https://github.com/XCMer/larry-four-generator/tree/Gadoma-extendedmodels

这篇关于在Laravel中进行逆向工程还是实体的自动生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆