Return relative image paths from API for Next.js frontend
Changed getFeaturedImageUrlAttribute to return relative paths (e.g., /images/blog/photo.jpg) instead of full Laravel storage URLs. Migrated image paths updated from migrated-images/ to images/ prefix. Images are now served from Next.js public/ directory via Vercel CDN. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -447,6 +447,7 @@ class Article extends Model
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return asset('storage/'.$this->featured_image_path);
|
// Return relative path for Next.js frontend (images served from public/)
|
||||||
|
return '/'.$this->featured_image_path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user