illuminate/database 如何去除 表名默认自带的s

ybbhui90

问题描述

使用 illuminate/database 之后
通过命令 php webman make:model AuthRole 生成的model
如图:
截图

查询语句:
$role = AuthRole::where(['status'=>1])->pluck('name','id');
报错:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wxshop.auth_roles' doesn't exist in /xxxxx/vendor/illuminate/database/Connection.php:368

请问在model 里面不主动写 protected $table = 'auth_role'; 的情况下,如何去除表名自带的s呢?

341 1 0
1个回答

mosquito
  • 暂无评论
×
🔝