46 lines
No EOL
1.6 KiB
PHP
46 lines
No EOL
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources\API;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class App 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->created_at,
|
|
'name' => $this->name,
|
|
'description' => $this->description,
|
|
'directUrl' => $this->direct_url,
|
|
'url' => $this->url,
|
|
'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,
|
|
]
|
|
/*'properties' => [
|
|
#'autoAccept' => $this->auto_accept,
|
|
#'untrustedWarning' => $this->untrusted_warning,
|
|
#'showOnWebpage' => $this->show_on_webpage,
|
|
#'stopAutoRedirect' => $this->stop_auto_redirect,
|
|
#'hideInAppList' => $this->hide_in_app_list,
|
|
#'userCantRemoveApp' => $this->user_cant_remove_app
|
|
]*/
|
|
|
|
];
|
|
}
|
|
} |