Studio: make grid checkbox rectangular and commit table changes
This commit is contained in:
48
app/Models/RecArtworkRec.php
Normal file
48
app/Models/RecArtworkRec.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Precomputed recommendation list for an artwork.
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $artwork_id
|
||||
* @property string $rec_type similar_hybrid|similar_visual|similar_tags|similar_behavior
|
||||
* @property array $recs Ordered array of artwork IDs
|
||||
* @property string $model_version e.g. "sim_v1"
|
||||
* @property \Carbon\Carbon $computed_at
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property-read Artwork $artwork
|
||||
*/
|
||||
final class RecArtworkRec extends Model
|
||||
{
|
||||
protected $table = 'rec_artwork_recs';
|
||||
|
||||
protected $fillable = [
|
||||
'artwork_id',
|
||||
'rec_type',
|
||||
'recs',
|
||||
'model_version',
|
||||
'computed_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'artwork_id' => 'integer',
|
||||
'recs' => 'array',
|
||||
'computed_at' => 'datetime',
|
||||
];
|
||||
|
||||
// ── Relations ──────────────────────────────────────────────────────────
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'artwork_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user