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/Token.php

24 lines
545 B
PHP
Raw Normal View History

2019-04-24 18:46:41 +00:00
<?php
namespace App\Http\Resources\oAuth;
use Illuminate\Http\Resources\Json\JsonResource;
class Token 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(),
'refresh_token' => $this->refreshToken
];
}
}