Studio: make grid checkbox rectangular and commit table changes

This commit is contained in:
2026-03-01 08:43:48 +01:00
parent 211dc58884
commit e3ca845a6d
89 changed files with 7323 additions and 475 deletions

View File

@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Item-item co-occurrence pair for behavior-based similarity.
*
* @property int $a_artwork_id
* @property int $b_artwork_id
* @property float $weight
* @property \Carbon\Carbon $updated_at
*
* @property-read Artwork $artworkA
* @property-read Artwork $artworkB
*/
final class RecItemPair extends Model
{
protected $table = 'rec_item_pairs';
public $incrementing = false;
public $timestamps = false;
protected $fillable = [
'a_artwork_id',
'b_artwork_id',
'weight',
'updated_at',
];
protected $casts = [
'a_artwork_id' => 'integer',
'b_artwork_id' => 'integer',
'weight' => 'double',
'updated_at' => 'datetime',
];
// ── Relations ──────────────────────────────────────────────────────────
public function artworkA(): BelongsTo
{
return $this->belongsTo(Artwork::class, 'a_artwork_id');
}
public function artworkB(): BelongsTo
{
return $this->belongsTo(Artwork::class, 'b_artwork_id');
}
}