From 885a1258e89de0f8adb54dce2585c725ad5534da Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 22 Nov 2019 22:34:56 -0700 Subject: [PATCH] Add AccountService --- app/Services/AccountService.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/Services/AccountService.php diff --git a/app/Services/AccountService.php b/app/Services/AccountService.php new file mode 100644 index 00000000..e14aadf8 --- /dev/null +++ b/app/Services/AccountService.php @@ -0,0 +1,29 @@ +addHours(12); + + return Cache::remember($key, $ttl, function() use($id) { + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $profile = Profile::whereNull('status')->findOrFail($id); + $resource = new Fractal\Resource\Item($profile, new AccountTransformer()); + return $fractal->createData($resource)->toArray(); + }); + } + +} \ No newline at end of file