array dot method

PHOTO EMBED

Thu Dec 02 2021 08:00:24 GMT+0000 (Coordinated Universal Time)

Saved by @sayedsadat344 #php #laravel

$original = [
    'user' => [
        'name' => 'foo',
        'occupation' => 'bar',
    ]
];
 
$dotted = Arr::dot($original);
 
// Results in...
$dotted = [
    'user.name' => 'foo',
    'user.occupation' => 'bar',
];
content_copyCOPY

https://laravel-news.com/laravel-8-74-0