Ejemplo n.º 1
0
 /**
  * Show a count of all online users on application
  * @param  [type] $query [description]
  * @return [type]        [description]
  */
 public function countOnlineUsers($query)
 {
     return $query->whereNotNull('user_id')->with('user')->count();
 }
Ejemplo n.º 2
0
 /**
  * Scope queries to assignments that have been finished
  *
  * @param  [type] $query [description]
  * @return [type]        [description]
  */
 public function scopeFinished($query)
 {
     $query->whereNotNull('finished_on');
 }