简体   繁体   English

从Laravel 5上的现有数据库开始

[英]Starting with existing database on Laravel 5

I have been enjoying working on Laravel for a while now, and am planning to move a fairly large project to Laravel 5. 我一直喜欢在Laravel工作一段时间,并计划将一个相当大的项目搬到Laravel 5。

The new project has fairly large database with numerous tables, and it would take considerable amount of time build migrations, models and controllers individually. 新项目拥有相当大的数据库,包含大量表,并且需要花费大量时间单独构建迁移,模型和控制器。

Has anybody worked on this before? 以前有人为此工作吗? What is the best way to go about it? 最好的方法是什么?

I have used this great extension to generate migrations as of now - but still for a 200+ tables, it would take quite a long time to do the rest. 到目前为止,我已经使用这个很棒的扩展来生成迁移 - 但是对于200多个表来说,剩下的工作还需要很长时间。

How about this: http://packalyst.com/packages/package/ignasbernotas/laravel-model-generator 怎么样: http//packalyst.com/packages/package/ignasbernotas/laravel-model-generator

Model generator Laravel 5 model generator for an existing schema. 用于现有模式的模型生成器Laravel 5模型生成器。

It plugs into your existing database and generates model class files based on the existing tables. 它会插入现有数据库并根据现有表生成模型类文件。

Try this one: https://github.com/reliese/laravel 试试这个: https//github.com/reliese/laravel

Reliese Laravel is a collection of Laravel Components which aim is to help the development process of Laravel applications by providing some convenient code-generation capabilities. Reliese Laravel是Laravel组件的集合,旨在通过提供一些方便的代码生成功能来帮助Laravel应用程序的开发过程。

For migrating models and controllers just use artisan commands, you can't get around it any easier than that. 对于迁移模型和控制器只需使用artisan命令,您无法轻松绕过它。 For the migrations I can suggest trying to use the following package: 对于迁移,我建议尝试使用以下包:

Laravel Database Exporter Laravel数据库导出器

It will export your existing DB schemas as Laravel migrations. 它将您现有的数据库模式导出为Laravel迁移。 My suggestion is based on the assumption that you are using MySQL as your RDBMS, because the package I suggested only works with that. 我的建议是基于你使用MySQL作为你的RDBMS的假设,因为我建议的包只适用于它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM