| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | #[ObservedBy([DiscussLogObserver::class])] |
||
| 14 | class DiscussLog extends Model |
||
| 15 | { |
||
| 16 | use DiscussLogPresenter; |
||
|
|
|||
| 17 | |||
| 18 | /** |
||
| 19 | * The attributes that are mass assignable. |
||
| 20 | * |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | protected $fillable = [ |
||
| 24 | 'user_id', |
||
| 25 | 'loggable_id', |
||
| 26 | 'loggable_type', |
||
| 27 | 'event_type', |
||
| 28 | 'data' |
||
| 29 | ]; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * The attributes that should be cast. |
||
| 33 | */ |
||
| 34 | protected function casts(): array |
||
| 35 | { |
||
| 36 | return [ |
||
| 37 | 'data' => 'array' |
||
| 38 | ]; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the user that owns the log. |
||
| 43 | * |
||
| 44 | * @return BelongsTo |
||
| 45 | */ |
||
| 46 | public function user(): BelongsTo |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get the loggable relation. |
||
| 53 | * |
||
| 54 | * @return MorphTo |
||
| 55 | */ |
||
| 56 | public function loggable(): MorphTo |
||
| 59 | } |
||
| 60 | } |
||
| 61 |