/** * Add Permissions to group * * @param \SaleBoss\Models\Group $group * @param array $permissions * * @return \SaleBoss\Models\Group */ public function addPermissions(Group $group, array $permissions) { $group->setPermissionsAttribute($permissions, false); $group->save(); return $group; }
/** * Add group permissions to defaults * * @param $group * @return void */ protected function addDefaults(Group $group) { foreach ($group->getPermissions() as $key => $permission) { $this->defaults[$group->id][$key] = $permission; } }