我正在学习 Laravel 和 PHP,我正在尝试使用 Artisan 的 Tinker 将帖子添加到我的表中。
我收到这些我不明白的错误:
Illuminate/Database/Eloquent/MassAssignmentException with message 'Add [username] to fillable property to allow mass assignment on [App/post].'
在我的 Post.php 模型中,我有:
protected $fillable = ['username', 'email', 'content'];
感谢您的帮助
最佳答案
尝试退出tinker并再次运行php artisan tiker
,tinker在运行时不会跟踪更改。
关于php - 将 [用户名] 添加到可填充属性以允许在 [应用程序/帖子] 上进行批量分配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59756078/