Iam learning Laravel and PHP, I am trying to add a post into my table by using Tinker from Artisan.
I receive these error I don't understand :
Illuminate/Database/Eloquent/MassAssignmentException with message 'Add [username] to fillable property to allow mass assignment on [App/post].'
In my Post.php model I have :
protected $fillable = ['username', 'email', 'content'];
Thank you for your help
尝试退出 tinker 并再次运行php artisan tiker
,tinker 在运行时不会跟踪更改。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.