src/Repositories/Acl/HCPermissionRepository.php
public function deletePermission(string $action): void
    {
        /** @var HCAclPermission $permission */
        $permission = $this->findOneBy(['action' => $action]);

        $permission->roles()->detach();

        $permission->forceDelete();
    }
public function deletePermission(string $action): void
    {
        /** @var HCAclPermission $permission */
        $permission = $this->findOneBy(['action' => $action]);

        $permission->roles()->detach();

        $permission->forceDelete();
    }
public function deletePermission ( string $ action ) : void { /** @var HCAclPermission $permission */ $ permission = $ this -> findOneBy ( [ 'action' => $ action ] ) ; $ permission -> roles ( ) -> detach ( ) ; $ permission -> forceDelete ( ) ; }
Deleting permission with and remove it from role_permission connection

@param string $action
@throws \Exception
Deleting permission with and remove it from role_permission connection