bookinventory/app/Services/BookInformation/CachedService.php
Tyler a1ac81a73a
All checks were successful
continuous-integration/drone/push Build is passing
Add attachments, more pages
2020-12-26 19:34:07 -05:00

19 lines
405 B
PHP

<?php
namespace App\Services\BookInformation;
use Cache;
class CachedService implements BookLookupService {
private $service;
public function __construct($service) {
$this->service = $service;
}
public function lookup($isbn) {
return Cache::remember('isbn_' . $isbn, 86400, function() use ($isbn) {
return $this->service->lookup($isbn);
});
}
}