Update AccountService, fixes #1834

pull/1843/head
Daniel Supernault 7 years ago
parent 5b8d2c4418
commit eb478ccf76
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -14,16 +14,16 @@ class AccountService {
public static function get($id) public static function get($id)
{ {
$key = self::CACHE_KEY . ':' . $id; // $key = self::CACHE_KEY . ':' . $id;
$ttl = now()->addHours(12); // $ttl = now()->addSeconds(10);
// return Cache::remember($key, $ttl, function() use($id) {
return Cache::remember($key, $ttl, function() use($id) { // });
$fractal = new Fractal\Manager();
$fractal->setSerializer(new ArraySerializer()); $fractal = new Fractal\Manager();
$profile = Profile::whereNull('status')->findOrFail($id); $fractal->setSerializer(new ArraySerializer());
$resource = new Fractal\Resource\Item($profile, new AccountTransformer()); $profile = Profile::whereNull('status')->findOrFail($id);
return $fractal->createData($resource)->toArray(); $resource = new Fractal\Resource\Item($profile, new AccountTransformer());
}); return $fractal->createData($resource)->toArray();
} }
} }
Loading…
Cancel
Save