# spatie/laravel-medialibrary

Associate files with Eloquent models

Repository: https://github.com/spatie/laravel-medialibrary
Canonical: https://ross.abutalabs.com/products/laravel-medialibrary
Homepage: https://spatie.be/docs/laravel-medialibrary
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, php, eloquent, media, upload, images, hacktoberfest
Last push: 2026-08-10T08:16:46+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 97, longevity 100
- inputs: {"age_days": 4159, "days_push": 23, "days_rel": 23, "gap_med": 9, "n_releases_24m": 46}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6159, forks 1100 (observed 2026-08-28T04:09:36.737983+00:00)

## What it is
A Laravel package that associates files of any type with Eloquent models via a fluent API. It handles uploads, stores media on any Laravel filesystem (local, S3, etc.), and generates derived images like thumbnails and responsive images for images, videos, and PDFs.

## Use cases
- attach uploaded images to eloquent models in laravel
- generate thumbnails for model media
- store user uploads on s3 instead of local disk
- manage media collections per model
- create responsive images for a laravel app
- handle file uploads from http requests in laravel
- associate pdfs and videos with database records

## When to choose
- you use Laravel/Eloquent and need model-attached file management
- you need multi-filesystem storage (local, S3) for media
- you want automatic thumbnail and responsive image generation

## When to avoid
- you are not using Laravel or Eloquent
- you need a standalone media CMS rather than a code library
- you need a ready-made upload UI without the paid Pro version

## Facets
- artifact type: library
- maturity: stable
- function: file-upload, image-processing, file-system, sdk
- domain: web-development, backend, media, files
- platform: php
- tags: laravel, eloquent, media-management, thumbnails, responsive-images, s3, orm

## Member repositories
- spatie/laravel-medialibrary (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:36.737983+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:47:29.125156+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-medialibrary (fetched 2026-08-28T04:09:36.737983+00:00, sha ff83e8d17be6)
  - homepage: https://spatie.be/docs/laravel-medialibrary (fetched 2026-08-29T08:44:29.124422+00:00, sha cd94bdbfcfe0)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T08:44:29.127055+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T08:44:29.129103+00:00, sha d3cb88e4b34c)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v11 (fetched 2026-08-29T08:44:29.131160+00:00, sha cd94bdbfcfe0)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v10 (fetched 2026-08-29T08:44:29.133344+00:00, sha 0e96d00c2da5)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v9 (fetched 2026-08-29T08:44:29.135219+00:00, sha 77cc6ecf657c)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v8 (fetched 2026-08-29T08:44:29.137008+00:00, sha 3960da9ade8a)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v7 (fetched 2026-08-29T08:44:29.138679+00:00, sha 8229873bb0ac)
  - site_page: https://spatie.be/docs/laravel-medialibrary/v6 (fetched 2026-08-29T08:44:29.140311+00:00, sha 1b4e61a09ea1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
