Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 6710c6f

Browse files
authored
Make it work with PHP 8.0
method_exists requires first parameter to be object or string now and won't accept a null parameter
1 parent 2930a1e commit 6710c6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Validation/Rules/DenyTrashed.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function isValid()
3030
*/
3131
protected function isTrashed()
3232
{
33-
return method_exists($this->model, 'trashed') && $this->model->trashed();
33+
if ($this->model) {
34+
return method_exists($this->model, 'trashed') && $this->model->trashed();
35+
}
36+
return false;
3437
}
3538
}

0 commit comments

Comments
 (0)