samedi 31 octobre 2015

Mass Assignment Expection with create and update methods

I have strange issue while using create or update methods on laravel tinker although i added $fillable array

table fields as follows

  1. id
  2. title
  3. body
  4. published_at
  5. 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