'integer', 'data' => 'array', ]; protected $appends = [ 'display_type', ]; protected function displayType(): Attribute { return Attribute::make( get: fn () => match ($this->type) { 'flight_booked' => 'Flight Booked', 'flight_cancelled' => 'Flight Cancelled', 'flight_updated' => 'Flight Updated', 'flight_imported' => 'Flight Imported', 'flight_logged' => 'Flight Logged', 'flight_deleted' => 'Flight Deleted', default => 'Unknown Action' } ); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } }