Skip to content

Commit

Permalink
Update DynamicRelations.php
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 authored Jun 7, 2020
1 parent 29235df commit f901114
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/DynamicRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public function getDynamicRelations()
return static::$dynamicRelations;
}

public static function defineNewMethod($name, $closure)
{
static::$dynamicRelations[$name] = $closure;
}

public function hasDynamicRelation(string $relation)
{
return isset(static::$dynamicRelations[$relation]);
Expand Down

0 comments on commit f901114

Please sign in to comment.