Skip to content

Commit

Permalink
Add macro check when populate relations
Browse files Browse the repository at this point in the history
  • Loading branch information
greabock authored Jul 15, 2021
1 parent cf2dbf7 commit 04bba38
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,7 @@ protected function fillRelations(Model $model, array $data): void

$relation = Str::camel($relation);

if (method_exists($model, $relation) && call_user_func([$model, $relation]) instanceof Relation) {

// if (is_string($relationData) || is_bool($relationData)) {
// dump(get_class($model));
// dump($relation);
// dump($relationData);
// dd();
// }
if ((method_exists($model, $relation) || $model::hasMacro($relation)) && $model->$relation() instanceof Relation) {

$this->populateRelation($model, $relation, $relationData);
}
Expand Down

0 comments on commit 04bba38

Please sign in to comment.