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.
Filament upload UX
SpatieMediaLibraryFileUpload on featured collection with imageEditor() disabled—editors crop externally to keep reproducible pipelines.
Alt text rules
Title-derived alt by default; manual override in SEO tab for descriptive heroes (accessibility + image search).
Broken image monitoring
Weekly Pulse check for 404 on /storage/* paths after disk migrations on aaPanel.
FAQ (extended)
WebP conversions?
Generated on queue; fallback JPEG for ancient clients via responsive picture in Blade fallback only.
CDN?
Cloudflare in front of /storage when traffic warrants—single VPS serves direct today.