mardi 19 juillet 2016

How to set field for ::create in Laravel?

I use this method to create new row in DB:

$input = $request->all();
return Recipient::create([$input]);

How I can add additional field to $input with an value?

I tried:

$input["user_id"] = Auth::id();

But when I display query INSERT, I can not see field user_id



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire