I have strange issue while using create or update methods on laravel tinker although i added $fillable array i receive mass assignment exception on 'title' or whatever field i added to the create or update methods
table fields as follows
- id
- title
- body
- published_at
- timestamps
model as follows
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
protected $fillable = ['title','body'];
}
command line i typed
$article = App\Article::create(['title' => 'ready']);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire