Spatie Media Library on aviwebsquad.in: featured images without OG chaos
Short answer: Blog posts on aviwebsquad.in use Spatie featured collection for cards and copy-to-og when Open Graph is empty—whether uploaded in Filament or via MCP media_upload.
Collections on BlogPost
public function registerMediaCollections(): void
{
$this->addMediaCollection('featured')->singleFile();
$this->addMediaCollection('og')->singleFile();
}
BlogPostMcpWriter copies featured → og after upsert if og missing—editors are not forced to upload twice.
Conversions I actually use
thumbfor admin tablescardfor blog index (fixed aspect)- Responsive images only on long-form heroes—not every card (CPU cost on a small VPS)
MCP upload path
Agents download Pexels (license-safe), POST multipart to /api/v1/mcp/media/upload:
mode=spatie
model=BlogPost
collection=featured
lookup[key]=slug
Filament shows the attachment instantly—same model ID.
SEO interaction
OG tags read from og collection URL first, then featured, then site default in [SeoSettings]. Works with crawlable HTML social meta tests.
FAQ
Public disk default is private?
Spatie defaults matter—featured uses public visibility or signed URLs break cards.
Replace image without changing slug?
Upsert new file to collection; conversions regenerate on queue (Horizon).
Attribution?
Pexels photos get photographer credit in image alt when possible—not legal advice, just courtesy.
Maintenance note (Sep 2026)
Re-validated internal links and examples against the live aviwebsquad.in CMS after the Hostinger migration; guidance in this article still matches production.