feat: music feature added

This commit is contained in:
2025-09-26 13:47:29 +03:30
parent 6d386f871c
commit 876768ad68
4 changed files with 165 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Music extends Model
{
use HasFactory;
protected $fillable = [
'user_id',
'title',
'artist',
'file_path',
'type', // public or private
];
// Relation to user (optional)
public function user()
{
return $this->belongsTo(User::class);
}
// Accessor for full URL
public function getUrlAttribute()
{
return asset('storage/' . $this->file_path);
}
}