forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuthClient.php
More file actions
37 lines (34 loc) · 925 Bytes
/
AuthClient.php
File metadata and controls
37 lines (34 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace ProcessMaker\Http\Resources;
class AuthClient extends ApiResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
$types = [];
if (!empty($this->redirect)) {
$types[] = 'authorization_code_grant';
}
if ($this->personal_access_client) {
$types[] = 'personal_access_client';
}
if ($this->password_client) {
$types[] = 'password_client';
}
return [
'id' => $this->id,
'name' => $this->name,
'secret' => $this->secret,
'redirect' => $this->redirect,
'revoked' => $this->revoked,
'types' => $types,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}