用一个命令和正确的复数结尾制作模型,迁移和控制器 [英] Make model, migration and controller with one command and right plural ending
本文介绍了用一个命令和正确的复数结尾制作模型,迁移和控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图找出一个命令行命令,以使Model,migration和controller具有正确的复数结尾和大小写,如下例所示:
I am trying to figure out the one command-line command to make Model, migration and controller with the right plural ending and case like the following example:
模型: 发布 .php
迁移: ### _ create_ 帖子 _table.php
Migration: ###_ create_ posts _table.php
Controller: 帖子 Controller.php
Controller: PostsController.php
我尝试过
php artisan make:model Posts -m -c
和
php artisan make:model Post -m -c
和
其他一些命令,但是我似乎无法获得能够解决所有问题的神奇命令.
a few other commands but I can't seem to get the magical one that solves them all.
推荐答案
这是为您提供的解决方案
This is the solution for you
php artisan make:model Post -mcr
这将创建模型Post
,控制器PostController
和迁移xxxx_create_posts_table
This will create a model Post
, controller PostController
and migration xxxx_create_posts_table
这篇关于用一个命令和正确的复数结尾制作模型,迁移和控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文