1 | <?php namespace Cviebrock\EloquentLogLazyLoading; |
||
3 | trait LogLazyLoading |
||
4 | { |
||
5 | |||
6 | /** |
||
7 | * Get a relationship value from a method. |
||
8 | * |
||
9 | * @param string $method |
||
10 | * |
||
11 | * @return mixed |
||
12 | * |
||
13 | * @throws \LogicException |
||
14 | * @throws \Cviebrock\EloquentLogLazyLoading\LazyLoadingException |
||
15 | */ |
||
16 | protected function getRelationshipFromMethod($method) |
||
32 | } |
||
33 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: