'boolean', 'is_latest' => 'boolean', 'published_at' => 'datetime', ]; public function package() { return $this->belongsTo(Package::class, 'package_id'); } public function getPhpExtensionsArrayAttribute() { $value = $this->php_extensions; if (empty($value)) { return []; } $decoded = json_decode($value, true); return is_array($decoded) ? $decoded : []; } }