Reducing authentication calls on external API (Laravel 5.6)
PHP Snippet 1:
$seconds = 3600; // seconds (=> 1 hour) until it expires
$value = Cache::remember('myToken', $seconds, function () {
$token = some code to obtain the token ...
return $token;
});