'int', 'user_id' => 'int', ]; protected $fillable = [ 'uuid', 'media_collection_id', 'user_id', 'media_type', 'media_source', 'media_provider', 'mime_type', 'file_name', 'file_path', 'disk', 'uploaded_url', ]; protected $appends = [ 'media_url', ]; public function media_collection() { return $this->belongsTo(MediaCollection::class); } protected function mediaUrl(): Attribute { return Attribute::make( get: function ($value, $attributes) { return Storage::disk($attributes['disk'])->url($attributes['file_path'].$attributes['file_name']); } ); } }