示例#1
0
 public function groups()
 {
     $limit = $this->property('maxItems', 0);
     $query = Group::isActive();
     // limit the results
     if ($limit > 0) {
         $query->take($limit);
     }
     return $query->get();
 }
示例#2
0
 public function onRun()
 {
     $groupID = $this->param('group_id');
     $query = Group::isActive();
     if (!is_numeric($groupID) || $groupID < 1) {
         $this->group = $query->where('url_slug', $groupID)->firstOrFail();
     } else {
         $this->group = $query->findOrFail($groupID);
     }
 }