0
点赞
收藏
分享

微信扫一扫

laravel中常见的错误


阅读目录

  • 命名空间这里路径写错了就会报这个错误
  • Add [userId] to fillable property to allow mass assignment on [App\Models\SignIn]
  • SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value

命名空间这里路径写错了就会报这个错误

namespace App\Http\Controllers;

Class App\Http\Controllers\Product\ProductController located in ./app/Http/Controllers/ProductController.php does not comply with psr-4 autoloading standard. Skipping.

laravel中常见的错误_字段

Add [userId] to fillable property to allow mass assignment on [App\Models\SignIn]

$signIn = new SignIn();
// 添加用户数据
$signIn_data=[
    'userId' => $userId,
    'num' => 1,
    'signTime' => date('Y-m-d H:i:s', time())
];
$signIn::create($signIn_data);

laravel中常见的错误_App_02


解决办法:添加可执行的字段。

laravel中常见的错误_php_03

SQLSTATE[HY000]: General error: 1364 Field ‘id’ doesn’t have a default value

laravel中常见的错误_字段_04


SQLSTATE[HY000]: 一般错误: 1364 字段 ‘id’ 没有默认值

laravel中常见的错误_App_05


举报

相关推荐

0 条评论