1 | <?php namespace App\Modules\V1\Core\Traits; |
||
3 | trait Translatable |
||
4 | { |
||
5 | /** |
||
6 | * Create a new model instance that is existing. |
||
7 | * |
||
8 | * @param array $attributes |
||
9 | * @param string|null $connection |
||
10 | * @return static |
||
11 | */ |
||
12 | public function newFromBuilder($attributes = [], $connection = null) |
||
26 | |||
27 | /** |
||
28 | * Returns a translatable model attribute based on the application's locale settings. |
||
29 | * |
||
30 | * @param $key |
||
31 | * @param $values |
||
32 | * @return string |
||
33 | */ |
||
34 | protected function getTranslatedAttribute($key, $values) |
||
52 | } |
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: