Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/ResourcesController.php
Show All 19 Lines | class ResourcesController extends RelationController | ||||
/** @var array Resource listing order (column names) */ | /** @var array Resource listing order (column names) */ | ||||
protected $order = ['name']; | protected $order = ['name']; | ||||
/** @var array Common object properties in the API response */ | /** @var array Common object properties in the API response */ | ||||
protected $objectProps = ['email', 'name']; | protected $objectProps = ['email', 'name']; | ||||
/** | /** | ||||
* Prepare resource statuses for the UI | |||||
* | |||||
* @param \App\Resource $resource Resource object | |||||
* | |||||
* @return array Statuses array | |||||
*/ | |||||
protected static function objectState($resource): array | |||||
{ | |||||
return [ | |||||
'isLdapReady' => $resource->isLdapReady(), | |||||
'isImapReady' => $resource->isImapReady(), | |||||
'isActive' => $resource->isActive(), | |||||
'isDeleted' => $resource->isDeleted() || $resource->trashed(), | |||||
]; | |||||
} | |||||
/** | |||||
* Resource status (extended) information | * Resource status (extended) information | ||||
* | * | ||||
* @param \App\Resource $resource Resource object | * @param \App\Resource $resource Resource object | ||||
* | * | ||||
* @return array Status information | * @return array Status information | ||||
*/ | */ | ||||
public static function statusInfo($resource): array | public static function statusInfo($resource): array | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |