php-uptelligence/Models/AssetVersion.php
Snider e0d2325a20 refactor: move namespace from Core\Uptelligence to Core\Mod\Uptelligence
Aligns module namespace with Core PHP Framework conventions where
modules live under the Core\Mod\ namespace hierarchy. This follows
the monorepo separation work started in 40d893a.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:32:55 +00:00

49 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace Core\Mod\Uptelligence\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Asset Version - tracks version history for assets.
*
* Stores changelog, breaking changes, and download information.
*/
class AssetVersion extends Model
{
use HasFactory;
protected $fillable = [
'asset_id',
'version',
'changelog',
'breaking_changes',
'download_url',
'local_path',
'released_at',
];
protected $casts = [
'breaking_changes' => 'array',
'released_at' => 'datetime',
];
public function asset(): BelongsTo
{
return $this->belongsTo(Asset::class);
}
public function hasBreakingChanges(): bool
{
return ! empty($this->breaking_changes);
}
public function isStored(): bool
{
return $this->local_path && file_exists($this->local_path);
}
}