jeudi 1 octobre 2015

ErrorException in Grammar.php line 39: Array to string conversion

This is my store function in CategorieController.php

public function store(Request $request) {
  Categorie::create([
  'name'=>$request['name'],
  ]);
  return redirect::to('/categorie');
}

and this is what I have in my model Categorie.php

class Categorie extends Model { 
  protected $table =['categories'];
  protected $fillable=['name'];
}

but when I try to save my categorie into database I get this error:

ErrorException in Grammar.php line 39: Array to string conversion



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire