Download the PHP package drewroberts/media without Composer
On this page you can find all versions of the php package drewroberts/media. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download drewroberts/media
More information about drewroberts/media
Files in drewroberts/media
Package media
Short Description Laravel Package for opinionated usage of Media (images & videos)
License MIT
Homepage https://github.com/drewroberts/media
Informations about the package media
Laravel Package for opinionated usage of Media (images & videos)
The media package utilizes Cloudinary for images and YouTube for videos. Create a free Cloudinary account for each Laravel application utilizing this package here:
Models
The following models are included in this package:
List of Models
- Image
- Tag
- Video
Installation
You can install the package via composer:
Environment variables (Cloudinary Laravel v3)
Add your Cloudinary credentials to your .env
file. Choose one of the following options:
Required env variables:
[!NOTE]
You can get your credentials from your Cloudinary console.
Configure the Cloudinary disk (required)
Add a cloudinary
disk to your config/filesystems.php
:
The package expects
filesystems.disks.cloudinary.cloud
to be set. If missing, URL helpers will throw an informative exception.
Media package config (optional)
This package ships with config/media.php
for its own options. You can publish and customize it:
Available options and defaults:
[!NOTE] In your Cloudinary console, create a Named Transformation called
t_cover
sized to 1200x630 pixels. This package references that name to render cover images.Create another Named Transformation
t_coverplaceholder
sized to 120x63 pixels. This is intended as a lightweight loading placeholder, while the fullt_cover
image can be lazy-loaded by the frontend.
YouTube Data API v3 (Non-OAuth)
This package integrates with the official YouTube Data API v3 using an API key (no OAuth). It is used to parse YouTube links, fetch video details (title, description, duration, publish date, statistics, etc.), and pick the best thumbnail.
Required env variable:
Notes
- Obtain an API key from your Google Cloud Console and enable the YouTube Data API v3 for your project.
- You can customize request timeout, base URL, and thumbnail selection order via
config/media.php
under theyoutube
key (publish the config if needed). - API quota or configuration issues will surface as clear exceptions; ensure the key is set in environments where the service is used.
Filament Admin Resources
This package ships first‑party Filament resources for managing media:
- Images: Resource, pages, form schema, and table
- Tags: Resource, pages, form schema, and table
- Videos: Resource, pages, form schema, and table, including:
- Create via YouTube URL/ID (fetches metadata on submit)
- Edit with read‑only metadata and editable “Internal Name”, “Credit”, and “Thumbnail”
- A “Refresh API Data” button on the edit page to pull the latest details from YouTube
How they’re registered
- The package provides a Filament plugin that auto‑discovers resources from
DrewRoberts\Media\Filament\Resources
. - In your Filament Panel config, install the package plugin (if not auto‑discovered in your setup).
User Resource in your application
- This package does not provide a Filament User resource. Your Laravel application should create its own Filament User resource with
php artisan make:filament-resource Customer
- The media models reference your app’s user model via
config('auth.providers.users.model')
forcreator_id
andupdater_id
relations. No additional wiring is required.
Migrations
This package auto-runs its migrations and does not publish them.
The following tables are created:
- images
- videos
- tags
- taggables
Note: Because migrations are auto-loaded, you don’t need to vendor:publish them. If you need to customize the schema, override with your own migrations in your application.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Drew Roberts
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of media with dependencies
cloudinary-labs/cloudinary-laravel Version ^3.0
filament/filament Version ^4.0.1
illuminate/contracts Version ^12.24
spatie/eloquent-sortable Version ^4.5
spatie/laravel-package-tools Version ^1.92