23 lines
No EOL
500 B
PHP
23 lines
No EOL
500 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\oAuth;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AccessToken extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'access_token' => $this->token,
|
|
'token_type' => 'bearer',
|
|
'expires_in' => strtotime($this->expires_at)-time(),
|
|
];
|
|
}
|
|
} |