feat: integrate Spotify API for syncing music productions with new command and UI components
This commit is contained in:
@@ -16,6 +16,11 @@ class MusicProduction extends Model
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'spotify_album_id',
|
||||
'spotify_url',
|
||||
'spotify_cover_url',
|
||||
'spotify_type',
|
||||
'spotify_synced_at',
|
||||
'cover_image',
|
||||
'content',
|
||||
'client_name',
|
||||
@@ -36,6 +41,7 @@ class MusicProduction extends Model
|
||||
|
||||
protected $casts = [
|
||||
'production_date' => 'date',
|
||||
'spotify_synced_at' => 'datetime',
|
||||
'gallery' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'sort_order' => 'integer',
|
||||
@@ -51,10 +57,23 @@ class MusicProduction extends Model
|
||||
if ($this->cover_image) {
|
||||
return asset('storage/' . $this->cover_image);
|
||||
}
|
||||
|
||||
if ($this->spotify_cover_url) {
|
||||
return $this->spotify_cover_url;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getDisplayCoverImageAttribute(): ?string
|
||||
{
|
||||
if ($this->cover_image) {
|
||||
return $this->cover_image;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('is_active', true);
|
||||
|
||||
Reference in New Issue
Block a user