/**
  * Create comment report
  *
  * @param User $user
  * @param Comment $comment
  * @return mixed
  */
 public function createCommentReport(User $user, Comment $comment)
 {
     if ($this->commentReport->findByUserAndComment($user, $comment)) {
         return false;
     }
     $this->stat->increment('reports');
     return $this->commentReport->create($user, $comment);
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (php_sapi_name() == 'cli' || !INSTALLED) {
         return $next($request);
     }
     $lastUpdate = $request->cookie('last_visit');
     if (!$lastUpdate || $lastUpdate->day != Carbon::now()->day) {
         $this->stat->increment('visits');
         $cookie = $this->cookieJar->forever('last_visit', Carbon::now());
         $this->cookieJar->queue($cookie);
     }
     return $next($request);
 }
 /**
  * Handle the event.
  *
  * @param UserCreatedThroughOAuth $event
  */
 public function handle(UserCreatedThroughOAuth $event)
 {
     $this->stat->increment('users');
 }
Exemplo n.º 4
0
 /**
  * Handle the event.
  *
  * @param  UserWasCreated  $event
  * @return void
  */
 public function handle(UserWasCreated $event)
 {
     $this->stat->increment('users');
 }
Exemplo n.º 5
0
 /**
  * Handle the event.
  *
  * @param  PostWasCreated  $event
  * @return void
  */
 public function handle(PostWasCreated $event)
 {
     $this->stat->increment('posts');
 }