From 77819a6dd062d2763b2073d841765ac807acb924 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 17 Mar 2019 19:12:18 -0600 Subject: [PATCH] Update IG Import Controller --- app/Http/Controllers/Import/Instagram.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Http/Controllers/Import/Instagram.php b/app/Http/Controllers/Import/Instagram.php index eef51f919..0b1486f31 100644 --- a/app/Http/Controllers/Import/Instagram.php +++ b/app/Http/Controllers/Import/Instagram.php @@ -22,6 +22,13 @@ trait Instagram public function instagramStart(Request $request) { + $completed = ImportJob::whereProfileId(Auth::user()->profile->id) + ->whereService('instagram') + ->whereNotNull('completed_at') + ->exists(); + if($completed == true) { + return redirect(route('settings'))->with(['errors' => ['You can only import from Instagram once.']]); + } $job = $this->instagramRedirectOrNew(); return redirect($job->url()); }