| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait HasAddress |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Boot the `HasAddress` trait for the model. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public static function bootHasAddress() |
||
| 15 | { |
||
| 16 | static::deleting(function ($model) { |
||
| 17 | $model->address()->delete(); |
||
| 18 | }); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The associated address relation. |
||
| 23 | * |
||
| 24 | * @return \Illuminate\Database\Eloquent\Relations\MorphOne |
||
| 25 | */ |
||
| 26 | public function address(): MorphOne |
||
| 29 | } |
||
| 30 | } |
||
| 31 |