Skip to content

Commit

Permalink
check if running in console
Browse files Browse the repository at this point in the history
  • Loading branch information
AshPowell committed Jul 3, 2019
1 parent 66ea488 commit c155dcd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/APAnalytics.php
Expand Up @@ -88,8 +88,9 @@ public function show($collection, $interval = 'count', $timeframe = null, $filte
}
}

abort_unless($this->canViewAnalytic($model, $matchArray, auth()->user()), 403, 'You dont have permission to view these analytics');

if (! app()->runningInConsole()) {
abort_unless(auth()->check() && $this->canViewAnalytic($model, $matchArray, auth()->user()), 403, 'You dont have permission to view these analytics');
}
if ($start) {
$matchArray['created_at']['$gte'] = mongoTime($start);
}
Expand Down

0 comments on commit c155dcd

Please sign in to comment.