Advertisement
IoanaBdn

Untitled

Jan 28th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. if (Cache::has('token'))
  2. {
  3. $this->token = Cache::get('token');
  4. //dd("has token");
  5. }
  6. else
  7. {
  8. $tokenObj = $this->createToken('https://lajumate.ro/test-web/ioana/create-token');
  9. $this->token = $tokenObj->token;
  10.  
  11. $secondsOfAvailability = $tokenObj->expires_at - time();
  12. $storageTime = $secondsOfAvailability - 600;
  13.  
  14. Cache::put('token', $tokenObj->token, $storageTime);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement