nhayder
119
2
Laravel

How to add new element to array

Posted 1 month ago by nhayder

i have this array fetched from db

$contact = Form::find($id);

// returning

{
    "name":"myapp",
    "email":"[email protected]",
    "phone":"+973424242",
    "message":"<p>p<\/p>",
    "updated_at":"2019-05-24 14:58:46",
    "created_at":"2019-05-24 14:58:46",
}

how to add another element to above array ????

"id" :"12",

Please sign in or create an account to participate in this conversation.