Files
HickLab3D_Dashboard/app/Models/ProjectListingLink.php
T
hermes d4928789c4
Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Add HL3D branding, Etsy Live/Draft paging and Projects lifecycle
Replace the old touchmark/PNG identity with the supplied lockup and
monogram, segmented role-aware navigation, Live/Draft listing filters
with generation-based cache invalidation, and admin Projects covering
immutable file revisions, listing live pointers, and exact-decimal
filament/packaging/shipping costing. Additive schema only; no Etsy
publication. Isolated clone tests: 301 tests, 1162 assertions.
2026-11-08 12:50:56 +00:00

52 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Database\Factories\ProjectListingLinkFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ProjectListingLink extends Model
{
/** @use HasFactory<ProjectListingLinkFactory> */
use HasFactory;
public const ALL_VARIATIONS = 'all';
protected $fillable = [
'project_id', 'shop_id', 'listing_id', 'variation_key', 'title_snapshot',
'state_snapshot', 'remote_updated_at', 'synced_at', 'live_release_id',
'lock_version', 'created_by', 'detached_at',
];
protected function casts(): array
{
return [
'remote_updated_at' => 'datetime',
'synced_at' => 'datetime',
'detached_at' => 'datetime',
];
}
public function project(): BelongsTo
{
return $this->belongsTo(Project::class);
}
public function liveRelease(): BelongsTo
{
return $this->belongsTo(ProjectRelease::class, 'live_release_id');
}
public function creator(): BelongsTo
{
return $this->belongsTo(User::class, 'created_by');
}
public function isDetached(): bool
{
return $this->detached_at !== null;
}
}