| 123456789101112131415161718192021222324 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Resources\Json\JsonResource;
- class AuthResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @return array<string, mixed>
- */
- public function toArray($request): array
- {
- return [
- 'access_token' => $this['access_token'],
- 'refresh_token' => $this['refresh_token'],
- 'token_type' => 'Bearer',
- 'expires_in' => 900, // 15 minutes
- 'refresh_token_expires_in' => 2592000, // 30 days
- ];
- }
- }
|