Skip to content

Commit

Permalink
Simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Sep 6, 2024
1 parent d5762a3 commit b956342
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Commands/ExportSites.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ public function handle()
{
$sites = SiteModel::all()
->mapWithKeys(function ($model) {
$config = [
'name' => $model->name,
'lang' => $model->lang ?? null,
'locale' => $model->locale,
'url' => $model->url,
'attributes' => $model->attributes ?? [],
];

return [
$model->handle => collect($config)->filter()->all()
$model->handle => collect([
'name' => $model->name,
'lang' => $model->lang ?? null,
'locale' => $model->locale,
'url' => $model->url,
'attributes' => $model->attributes ?? [],
])->filter()->all()
];
});

Expand Down

0 comments on commit b956342

Please sign in to comment.