| 1 | <?php |
||
| 7 | trait EloquentUuidTrait |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Return uuidKey |
||
| 11 | * |
||
| 12 | * @return string |
||
| 13 | */ |
||
| 14 | public function getUuidColumn() |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Boot the Uuid trait for the model. |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | public static function bootEloquentUuidTrait() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Scope a query on uuid. |
||
| 34 | * |
||
| 35 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
| 36 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 37 | */ |
||
| 38 | public function scopeOnUuid($query, $uuid) |
||
| 45 | } |
||
| 46 |
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: