This commit is contained in:
ct
2025-06-19 13:16:17 +08:00
parent 4545fd64c6
commit 5d3a3c8818
19 changed files with 854 additions and 108 deletions

View File

@@ -12,6 +12,7 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Pgvector\Laravel\HasNeighbors;
use Pgvector\Laravel\Vector;
use Spatie\Tags\HasTags;
/**
* Class MemeMedia
@@ -33,13 +34,15 @@
*/
class MemeMedia extends Model
{
use HasNeighbors, SoftDeletes;
use HasNeighbors, SoftDeletes, HasTags;
protected $table = 'meme_medias';
protected $casts = [
'embedding' => Vector::class,
'duration' => 'double',
'keywords' => 'array',
'is_enabled' => 'boolean',
];
protected $fillable = [
@@ -85,7 +88,7 @@ class MemeMedia extends Model
protected function ids(): Attribute
{
return Attribute::make(
get: fn ($value, $attributes) => hashids_encode($attributes['id']),
get: fn($value, $attributes) => hashids_encode($attributes['id']),
);
}
}