Skip to content

Commit c7c7416

Browse files
authored
Merge pull request #4181 from Laravel-Backpack/use-string-classes-instead-of-objects
Comparing string classes instead of objects
2 parents 8ed9515 + c32c72c commit c7c7416

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/Library/CrudPanel/Traits/Relationships.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,12 @@ private function modelMethodIsRelationship($model, $method)
342342

343343
if ($returnType) {
344344
$returnType = $returnType->getName();
345-
if (is_a((new $returnType), 'Illuminate\Database\Eloquent\Casts\Attribute')) {
345+
346+
if (is_a($returnType, 'Illuminate\Database\Eloquent\Casts\Attribute', true)) {
346347
return false;
347348
}
348349

349-
if (is_a((new $returnType), 'Illuminate\Database\Eloquent\Relations\Relation')) {
350+
if (is_a($returnType, 'Illuminate\Database\Eloquent\Relations\Relation', true)) {
350351
return $method;
351352
}
352353
}

0 commit comments

Comments
 (0)