From a774ad7373b5ee279b07d702e3cbad5e969f0388 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 10 Dec 2018 20:36:27 -0700 Subject: [PATCH] Update InternalApiController --- .../Controllers/InternalApiController.php | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index fbab7a46a..fb4cdcde9 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -94,37 +94,6 @@ class InternalApiController extends Controller return $status->url(); } - public function notifications(Request $request) - { - $this->validate($request, [ - 'page' => 'nullable|min:1|max:3', - ]); - - $profile = Auth::user()->profile; - $timeago = Carbon::now()->subMonths(6); - $notifications = Notification::with('actor') - ->whereProfileId($profile->id) - ->whereDate('created_at', '>', $timeago) - ->orderBy('id', 'desc') - ->simplePaginate(30); - $notifications = $notifications->map(function($k, $v) { - return [ - 'id' => $k->id, - 'action' => $k->action, - 'message' => $k->message, - 'rendered' => $k->rendered, - 'actor' => [ - 'avatar' => $k->actor->avatarUrl(), - 'username' => $k->actor->username, - 'url' => $k->actor->url(), - ], - 'url' => $k->item->url(), - 'read_at' => $k->read_at, - ]; - }); - return response()->json($notifications, 200, [], JSON_PRETTY_PRINT); - } - // deprecated public function discover(Request $request) {