public function run()
 {
     $adminGroup = GroupItem::findGroup(adminGroup());
     if ($adminGroup) {
         UserItem::create(array('group_id' => $adminGroup->id, 'full_name' => 'Admin User', 'username' => 'admin', 'email' => '*****@*****.**', 'password' => Hash::make('password')));
     }
 }
 public function getAddedByName($group_name)
 {
     $group = GroupItem::findGroup($group_name);
     if ($group) {
         $gtp = GroupToPermissionItem::firstOrCreate(array("group_id" => $group->id, "permission_id" => $this->id));
         $gtp->save();
     }
 }
 public function scopeFilterNotGroup($query, $group_name)
 {
     return $query->where("group_id", "!=", GroupItem::findGroup($group_name)->id);
 }
Example #4
0
/**
 * Find Group
 */
function findGroup($name)
{
    return \Developeryamhi\AuthModule\GroupItem::findGroup($name);
}