Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function __call($method, $parameters) |
||
29 | { |
||
30 | #i: Convert array to dot notation |
||
31 | $config = implode('.', ['asgard.block.config.relations', $method]); |
||
32 | |||
33 | #i: Relation method resolver |
||
34 | if (config()->has($config)) { |
||
35 | $function = config()->get($config); |
||
36 | |||
37 | return $function($this); |
||
38 | } |
||
39 | |||
40 | #i: No relation found, return the call to parent (Eloquent) to handle it. |
||
41 | return parent::__call($method, $parameters); |
||
42 | } |
||
43 | |||
49 |