Remove permission from ermission container

@param $permission
@return $this
333408
public function removePermission($permission)
    {
        if ($this->hasPermission($permission)) {
            $index =  array_search($permission, $this->permissions);
            unset($this->permissions[$index]);
        }

        return $this;
    }
1196775
public function checkPermission($permission)
    {
        return $this->getPermissions()->contains(function ($value) use ($permission) {
            return $permission == $value->id || Str::is($permission, $value->slug);
        });
    }
186763
public function hasPermission($permission)
    {
        foreach ($this->permissions()->get() as $p) {
            if ($p->name == $permission) {
                return true;
            }
        }
        return false;
    }
217857
public function findWithoutPermission($permission)
    {
        return array_filter(
            $this->findAll(),
            function ($user) use ($permission) {
                return $user->hasnt($permission);
            }
        );
    }
270856
public function checkPermission($permission)
    {
        $roleAttribute = "can_{$permission}";
        return isset($this->$roleAttribute) ? (bool)$this->$roleAttribute : false;
    }
408786
public function addPermission(string ...$permission)
    {
        foreach ($permission as $_permission)
        {
            $this->permissionRegistry->save($_permission);
        }
    }
802811
public static function createFromObject($permission)
    {
        // Make sure the id is typecast to an integer.
        $id = ! is_null($permission->resource_id) ? (int) $permission->resource_id : null;

        if ($permission->type === Privilege::TYPE) {
            return new Privilege(
                $permission->action,
                new SimpleResource($permission->resource_type, $id)
            );
        } elseif ($permission->type === Restriction::TYPE) {
            return new Restriction(
                $permission->action,
                new SimpleResource($permission->resource_type, $id)
            );
        } else {
            throw new InvalidPermissionType("The permission type you provided \"{$permission->type}\" is incorrect.");
        }
    }
1248448
public function removeRolePermission($role, $permission)
    {
        $role       =   $this->findRoleByKey($role);
        $permission =   $this->findPermissionByKey($permission);

        return $role->remove($permission);
    }
1167854
public function deletePermission($permission)
    {
        if ($this->hasPermission($permission)) {
            return PermissionRole::where(
                    ['role_id' => $this->id, 'permission_id' => $permission->id]
                )->first()->delete();
        }

        return false;
    }
195123
public function hasPermission($permission)
    {
        return $this->roles->each(function ($role) use ($permission) {
            if (in_array($permission, explode(',', $role->permissions))) {
                return true;
            }
        });

        return false;
    }
900061
protected function storePermission(Permission $permission)
    {
        // Don't re-store the permission if it already exists.
        if (! $this->hasPermission($permission)) {
            $this->getDriver()->storeCallerPermission($this->caller, $permission);
        }
    }
254852
public function hasPermission($permission, $all = false)
    {
        if ($this->isPretendEnabled()) {
            return $this->pretend('hasPermission');
        }

        if (!$all) {
            return $this->hasOnePermission($permission);
        }

        return $this->hasAllPermissions($permission);
    }
989138
public function setPermissions($permissions)
    {
        if (! is_array($permissions)) {
            $permissions = [$permissions];
        }

        $this->permissions = $permissions;

        return $this;
    }
597210
public function revokePermission($permission)
    {
        if ($this->hasPermission($permission)) {
            unset($this->permissions[$permission]);
            return true;
        } else {
            return false;
        }
    }
197247
public function removePermission(
        UUID $uuid,
        Permission $permission
    ) {
        if (in_array($permission, $this->permissions)) {
            $this->apply(new PermissionRemoved($uuid, $permission));
        }
    }
196638
public function matchesPermission(Permission $permission)
    {
        return (
            $this instanceof $permission &&
            $this->action === $permission->getAction() && // Not using matchesAction to avoid the wildcard
            $this->matchesResource($permission->getResource())
        );
    }
508496
public function removeFamilyPermission(FamilyPermission $familyPermission)
    {
        $this->familyPermissions->removeElement($familyPermission);
        $familyPermission->setGroup(null);

        return $this;
    }