Laravel从数据库或迁移脚本生成模型,视图和控制器 [英] Laravel generate models, views and controllers from database or migration script
问题描述
我是Laravel 4的新手。我想知道是否可以从现有数据库生成模型,视图和控制器? I Googled and found
I am new to Laravel 4. I wanted to know if it is possible to generate Models , Views and Controllers from existing database? I Googled and found
https://github.com/JeffreyWay/Laravel-4-Generators
但是它允许通过提供资源名称来生成迁移脚本,模型,视图和控制器,通过命令行我想从现有的数据库创建模型,视图和控制器。
But it allow to generate migration script, model, views and controllers by providing resource name where as i want to reverse engineering of the same in which by command line i want to create models, views and controllers from the existing database.
推荐答案
php artisan generate:model dbtablename
将为您现有的数据库创建单独的模型。不需要使用
will create individual model for your existing database.in this case you do not need to use
php artisan generate:resource command
Laravel-4-Generators是非常好的文件。仔细阅读,你会发现它。有乐趣。
"Laravel-4-Generators" is very well documented.read it thoroughly and you will find it. have fun.
这篇关于Laravel从数据库或迁移脚本生成模型,视图和控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!