mercredi 7 mars 2018

How to add item to an array inside a collection in Laravel

I have a Laravel Request object (collection) and there is an array inside this (address array) I want to add a item to this array. I tried $request->address['state'] = 'test'; and following error occurred.

Indirect modification of overloaded property Illuminate\Http\Request::$address has no effect

Here is the request collection

I want to add a item like highlighted in this img



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire