dongqichang7988
dongqichang7988
2016-08-28 06:56

Laravel迁移是否对模型严肃对待语法?

I speak English, but not that good when it comes to grammar.

Now this question is about Laravel Framework.

Lately I've been developing a project using Laravel, normal day. But then, I started to make a migration

php artisan make:migration create_quizs_table --create=quizs

Created a few create query using php artisan tinker, yes all goes fine.

But then I refresh my migration just for curiosity, php artisan migrate:refresh, and here's what I get when I try to load pages using table quizs, after I:

  1. Created a Quiz Model, App\Quiz.php from artisan,
  2. try Eloquent technique to retrieve simple database ::all() query.

The Error on my browser:

There is an error ... with 'quizzes' something.

At this point, I learned that the plural of quiz is quizzes, not quizs. Is Laravel that strict on that, especially Model, since I noticed, Model use Singular without those s-es such as Quiz, Note, Book etc.

I have to figure out my English just to solve this.

Sadly, I don't have any log as `too much tinkering` corrupt my project. 

But that is what I recall clearly, for I learned the plural of quiz from Laravel, thanks I guess. I believe you can recreate the issue too by creating quizs table, with wrong grammar.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

相关推荐