示例#1
0
 /**
  * Get groups from the database
  *
  * @return mixed
  */
 protected function dbGroups()
 {
     // Get groups from the database
     $dbGroups = $this->group->getForUser(\Auth::user()->id);
     // Get groups from UserGroup object
     $groups = [];
     foreach ($dbGroups as $group) {
         $groups[] = $group->group;
     }
     return $groups;
 }
示例#2
0
 /**
  * Is owner
  *
  * @param mixed $model
  * @return bool
  */
 public function isOwner($model)
 {
     return \Auth::user()->id == $model->user_id;
 }