Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/Admin/DomainsController.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | public function index() | ||||
} | } | ||||
} elseif (!empty($search)) { | } elseif (!empty($search)) { | ||||
if ($domain = Domain::where('namespace', $search)->first()) { | if ($domain = Domain::where('namespace', $search)->first()) { | ||||
$result->push($domain); | $result->push($domain); | ||||
} | } | ||||
} | } | ||||
// Process the result | // Process the result | ||||
$result = $result->map(function ($domain) { | $result = $result->map( | ||||
$data = $domain->toArray(); | function ($domain) { | ||||
$data = array_merge($data, self::domainStatuses($domain)); | return $this->objectToClient($domain); | ||||
return $data; | } | ||||
}); | ); | ||||
$result = [ | $result = [ | ||||
'list' => $result, | 'list' => $result, | ||||
'count' => count($result), | 'count' => count($result), | ||||
'message' => \trans('app.search-foundxdomains', ['x' => count($result)]), | 'message' => \trans('app.search-foundxdomains', ['x' => count($result)]), | ||||
]; | ]; | ||||
return response()->json($result); | return response()->json($result); | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |