[英]Add [title] to fillable property to allow mass assignment on [App\Post]
[英]Add [username] to fillable property to allow mass assignment on [App/post]
我正在學習 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 在運行時不會跟蹤更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.