Laravel - name a model using a reserved word

前端 未结 1 1692
梦毁少年i
梦毁少年i 2021-01-19 15:54

I know it\'s not possible to use a reserved word in PHP as class name, but my Laravel app enables managing of courses and classes, so I have a database table called cl

1条回答
  •  抹茶落季
    2021-01-19 16:21

    Laravel doesn't force you to use specific names for your models or controllers. It's just a convention. You can name your model whatever you want it to be. the only amend you will have to make is to declare protected $table = 'classes' in your model

    0 讨论(0)
提交回复
热议问题