mardi 20 juillet 2021

Laravel Equivalent to JavaScript's ...prev

I'm trying to add an attribute to be passed in data but I would like all other attributes to stay.

$data = $request->all();

Is it possible to do this:

$data =[...data, 'Total'=> $total]

I think that ...data is for javascript. Is there an equivalent in laravel?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire