EventHistoryType::class ]; // * RELATIONSHIPS /** * BelongsTo user relation * * Get the user that owns the historique. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo(User::class); } /** * BelongsTo media relation * * Get the media that owns the historique. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function media() { return $this->belongsTo(Media::class); } // * METHODS /** * Get the instance as an array. * * @return array */ public function toArray(): array { return \array_merge( parent::toArray(), [ 'type' => [ 'value' => $this->type, 'label' => $this->type->label() ] ] ); } }