Update
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Pgvector\Laravel\Vector;
|
||||
@@ -46,4 +47,28 @@ class BackgroundMedia extends Model
|
||||
'embedding',
|
||||
'prompt',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'list_type',
|
||||
'area',
|
||||
'location_name',
|
||||
'status',
|
||||
'media_uuid',
|
||||
'embedding',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'ids',
|
||||
];
|
||||
|
||||
protected function ids(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value, $attributes) => hashids_encode($attributes['id']),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user