8000 Rules/DenyTrashed Throws error - PHP 8.0 · Issue #907 · Adldap2/Adldap2-Laravel · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
Rules/DenyTrashed Throws error - PHP 8.0 #907
@Honokai

Description

@Honokai

Environment

  • Laravel Version: 8.26.1
  • Adldap2-Laravel Version: 6.1.4
  • PHP Version: 8.0.2
  • LDAP Type: ActiveDirectory

Description:

On auth validation, Rule DenyTrashed throws error on php 8, where on older php versions would be a warning.

I did a work-around creating a rule pretty much the same but adding a condition to function isTrashed()

if ($this->model == null) {
    return false;
} else {
    return method_exists($this->model, 'trashed') && $this->model->trashed();
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0