从Laravel中的数据库创建模型 [英] Create Models from database in Laravel

查看:74
本文介绍了从Laravel中的数据库创建模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Laravel中是否可以通过某种方式从数据库中生成模型?

generators包仅创建一个空模型.

解决方案

有一个库 解决方案

There is a library Eloquent Model Generator which aim is creating Eloquent models classes using database tables as a source. It generates not only class stub, but relation methods, docblocks for magic fields, additional properties etc.

It provides a console command php artisan krlove:generate:model ClassName for generating one class per one call, but you can create your own command to call this command for each table from your database.

这篇关于从Laravel中的数据库创建模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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