This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/app/Http/Resources/oAuth/AccessToken.php

23 lines
500 B
PHP
Raw Permalink Normal View History

2019-04-24 18:46:41 +00:00
<?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(),
];
}
}