$user->retailerInfo = reset($user->retailerInfo);
This should do the trick for you. I had faced a similar issue that i wanted to “un-nest” an array this helped me solve it.
More Related Contents:
- Get first and second element of array [duplicate]
- Getting particular object
- How to get the first key of many duplicated json key? [duplicate]
- PHP Foreach returns separated(individual) arrays
- How to Convert string response to array laravel
- How would I build this JSON using a PHP array
- json_decode to array
- How to convert JSON string to array
- Preferred method to store PHP arrays (json_encode vs serialize)
- How I can put composite keys in models in Laravel 5?
- PHP Array to JSON Array using json_encode(); [duplicate]
- Difference between method calls $model->relation(); and $model->relation;
- Parsing JSON with PHP
- How to set a default attribute value for a Laravel / Eloquent model?
- How do I `json_encode()` keys from PHP array?
- Accessing JSON array after json_decode/multidimensional array
- Laravel 3 : Looking for explanation how to use the model
- laravel collection to array
- How to search through a JSON Array in PHP
- How to insert json array into mysql database
- How to iterate through a nested stdClass? [duplicate]
- PHP: Most frequent value in array
- Laravel collection converts array to object
- Use json_decode() to create array insead of an object
- Check if laravel model got saved or query got executed
- How to use a string as an array index path to retrieve a value?
- Laravel PHP Command Not Found
- Laravel – Model Class not found
- PHP – Find parent key of array
- Warning: array_combine(): Both parameters should have an equal number of elements