laravel-medialibrary

Organize and serve media assets in Laravel using Spatie's Media Library.

Updated Feb 23, 2025
One-click install
npx skills add https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n --skill laravel-medialibrary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-medialibrary
Source: https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n/tree/main/.claude/skills/laravel-medialibrary
Command: npx skills add https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n --skill laravel-medialibrary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing media assets (images, PDFs, videos) across Laravel apps can be error-prone and slow. This skill provides a comprehensive workflow to upload, store on any disk, generate image conversions, attach metadata, and serve files with automatic URLs across collections.

Core Features & Use Cases

  • Attach media to Eloquent models and organize into collections
  • Store on local or cloud disks (e.g., S3) with conversion pipelines and responsive images
  • Define custom properties and retrieve URLs or inline media for rendering

Quick Start

Upload a sample image to a model and render its thumbnail using the media library.

Frequently Asked Questions about laravel-medialibrary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage media uploads and image conversions in a Laravel application?

You can manage media uploads and image conversions in Laravel by attaching files to Eloquent models, organizing them into collections, and defining conversion pipelines to automatically generate and serve optimized image variants.

Can I store Laravel media files on S3 and still generate responsive images locally?

Yes, Laravel media management supports storing files on any disk, including S3 or local storage, while simultaneously generating responsive images and conversion variants across your defined collections.

What is the best way to attach metadata and retrieve media URLs for Laravel Eloquent models?

The best way to attach metadata and retrieve media URLs is by registering media collections on your Eloquent models, defining custom properties during upload, and using automatic URL generation to fetch assets for rendering.

Do I need to configure anything specific to serve media across different collections in Laravel?

Yes, you need to register media collections on your Eloquent models and define conversion pipelines to properly organize, process, and automatically generate serving URLs for media assets across different collections.

Does this approach to media management work for handling PDFs and videos alongside images?

Yes, this media management approach handles various media assets including PDFs, videos, and images, allowing you to attach them to models, store them on configured disks, and manage their metadata.