public function savePermissions($inputPermissions) { // If the inputPermissions ist empty it will delete all associations $changes = $this->permissions()->sync($inputPermissions); $this->flushCache(); return $changes; }