Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Cache::has('token'))
- {
- $this->token = Cache::get('token');
- //dd("has token");
- }
- else
- {
- $tokenObj = $this->createToken('https://lajumate.ro/test-web/ioana/create-token');
- $this->token = $tokenObj->token;
- $secondsOfAvailability = $tokenObj->expires_at - time();
- $storageTime = $secondsOfAvailability - 600;
- Cache::put('token', $tokenObj->token, $storageTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement