Laravel assumes the database table is the plural form of the model name

前端 未结 4 1474
南笙
南笙 2021-01-11 14:09

By default, Laravel is assuming that the database table is the plural form of the model name. But what if my table name is \"news\" and i still want to use this feature? sho

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-11 14:51

    You may specify a custom table by defining a table property on your model as below

    Ref:https://laravel.com/docs/5.1/eloquent

提交回复
热议问题