feat: integrate Spotify API for syncing music productions with new command and UI components

This commit is contained in:
Ümit Tunç
2026-05-20 22:31:41 +03:00
parent f35632ee0d
commit 751b9339f0
15 changed files with 666 additions and 9 deletions
+19
View File
@@ -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);