Download the PHP package devanderson/filament-media-gallery without Composer

On this page you can find all versions of the php package devanderson/filament-media-gallery. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-media-gallery

Filament Media Gallery

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A complete media gallery plugin for Filament v4 with support for image and video uploads, integrated image editor, automatic video thumbnail generation, and much more.

🌟 Features

πŸ“‹ Requirements

πŸ“¦ Installation

1. Install via Composer

2. Publish Migrations

3. Publish Configuration (Optional)

πŸš€ Basic Usage

Understanding the Component

The GalleryMediaField is a custom Filament form component designed to browse and select one or more media items (images or videos) from a pre-existing gallery. It stores the IDs of the selected media, which are then used to create a many-to-many relationship between your primary model and the media models (Image, Video) provided by the gallery package.

Step 1: Add the Component to Your Form

Add GalleryMediaField to your Filament form schema. You must specify the mediaType and a name for the field that will hold the selected IDs.

Field Configuration:

Step 2: Create Pivot Tables

A many-to-many relationship requires a "pivot" table to link your model with the media model. You need one pivot table for each media type you want to associate.

Image Pivot Table Migration

Video Pivot Table Migration

Step 3: Define Model Relationships

In your primary model, define the belongsToMany relationship for each media type. You must specify the custom pivot table name as the second argument.

Step 4: Integrate with Filament Resource Pages

To make the component work properly, you need to add logic to your Filament CreateRecord and EditRecord pages to handle saving and loading the relationship data.

Using the ProcessUploadGallery Trait

The package provides a convenient trait that handles all the synchronization logic:

CreateRecord Page:

EditRecord Page:

What the Trait Does:

Complete Form Example

πŸ“ Advanced Usage Examples

Single Image Selection (Avatar, Cover, etc)

Limited Selection with Max Items

Video Gallery

βš™οΈ Configuration

The config/filament-media-gallery.php file offers various options:

🎬 FFmpeg Setup (Video Thumbnails)

To enable automatic thumbnail generation for videos, install FFmpeg:

Ubuntu/Debian

macOS

Windows

Download from: https://ffmpeg.org/download.html

Configure in .env

⚠️ Important Notes

Modal Forms Limitation

This implementation has been designed for use in standard Filament CreateRecord and EditRecord pages. It has not been tested within the context of modal forms (e.g., createOptionForm or editOptionForm inside a Select component). Using this component in modals may require additional adjustments to correctly handle the component's state and data flow.

Relationship Synchronization

The ProcessUploadGallery trait automatically handles the synchronization of media relationships. It:

  1. Extracts field names ending with _ids from the form data
  2. Converts field names to relationship names (e.g., videos_ids β†’ videos)
  3. Syncs the selected IDs with the corresponding relationship
  4. Removes the temporary _ids fields from the saved data

🌍 Internationalization

The plugin includes translations for:

To add new translations:

πŸ§ͺ Testing

πŸ“ Changelog

See CHANGELOG for more information about recent changes.

🀝 Contributing

Contributions are welcome! See CONTRIBUTING for details.

πŸ”’ Security

If you discover security issues, please email [email protected].

πŸ“„ License

The MIT License (MIT). See License File for more information.

πŸ™ Credits

πŸ’‘ Support


All versions of filament-media-gallery with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/forms Version ^4.0
spatie/laravel-package-tools Version ^1.15.0
filament/filament Version ^4.0
intervention/image Version ^2.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devanderson/filament-media-gallery contains the following files

Loading the files please wait ...