2019-06-06 13:44:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources\API;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
class AppForOwner extends JsonResource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => (int)$this->id,
|
|
|
|
'created_at' => $this->created_at,
|
|
|
|
'updated_at' => $this->updated_at,
|
|
|
|
'name' => $this->name,
|
|
|
|
'description' => $this->description,
|
|
|
|
'url' => $this->url,
|
|
|
|
'directUrl' => $this->direct_url,
|
|
|
|
'apiKey' => $this->apiKey,
|
|
|
|
'apiSecret' => $this->apiSecret,
|
2019-09-24 14:02:39 +00:00
|
|
|
'iconURL' => $this->iconURL,
|
2019-06-06 13:44:45 +00:00
|
|
|
'properties' => [
|
2019-06-20 14:46:50 +00:00
|
|
|
'testingWarning' => (bool)$this->testing_warning,
|
|
|
|
'autoAccept' => (bool)$this->auto_accept,
|
|
|
|
'untrustedWarning' => (bool)$this->untrusted_warning,
|
|
|
|
'showOnWebpage' => (bool)$this->show_on_webpage,
|
|
|
|
'stopAutoRedirect' => (bool)$this->stop_auto_redirect,
|
2019-12-02 13:26:32 +00:00
|
|
|
'hideInAppList' => (bool)$this->hidden_in_app_list,
|
2019-06-20 14:46:50 +00:00
|
|
|
'userCantRemoveApp' => (bool)$this->user_cant_remove_app
|
|
|
|
],
|
|
|
|
'access' => [
|
|
|
|
'oAuth' => (bool)$this->access_oAuth,
|
|
|
|
'api' => (bool)$this->access_api,
|
|
|
|
'update_apps' => (bool)$this->access_update_apps,
|
|
|
|
'update_profile' => (bool)$this->access_update_profile,
|
|
|
|
'update_access' => (bool)$this->access_update_access,
|
|
|
|
'read_access' => (bool)$this->access_read_access,
|
|
|
|
'read_apps' => (bool)$this->access_read_apps,
|
|
|
|
'read_profile' => (bool)$this->access_read_profile,
|
2019-06-06 13:44:45 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|
2019-09-24 14:02:39 +00:00
|
|
|
}
|