I have controller like this
$test= test::find($id);
return $test;
return null but when I change it to
$test= test::where('id',$id)->get();
return $test;
return all value of $test My migration is
Schema::create('tests', function (Blueprint $table) {
$table->increments('id');
$table->string('user', 20);
}),
This is my model:
public $fillable = [
'user'
];
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire