Components
Media Library
Integrations
Installation
Thank you for purchasing the ultimate Media Library plugin for Filament! In this guide I'll show you how to install the library, so you can start using it right away.
Prerequisites
Depending on whether you want to use the Media Library inside a panel or also outside a panel in your custom forms, you need to have at least Filament and/or Filament Forms installed.
The Filament Media Library Pro is compatible with Laravel 11 or higher and Filament V4.
Installation
Add Composer repository
The Media Library is hosted on a private Composer repository. Run the following command to add the repository to your composer.json:
If you have one of my other premium packages installed already, then you don't need to repeat these lines.
The end result should look something like this:
Require the package
Next, run the following command to require the package:
This will install the package. If you receive a question to allow the plugin to run code, select yes. Next, you will be prompted for your username (which is your e-mail) and your password (which is your license key, e.g. 8c21df8f-6273-4932-b4ba-8bcc723ef500).
Composer will ask if you want to store your credentials in your global
auth.json. If you want to store the credentials per project and not globally, run the following command to create anauth.jsonfile in the root of your project instead:composer config http-basic.satis.ralphjsmit.com {your_username} {your_password}(ensure not to commit theauth.jsonfile by adding it to your.gitignorefile).
If you have a Solo-license and are getting a 403 error, then you probably have run out of device activations. Check your license email for a link to remove an existing activation or upgrade your license.
Setup a custom theme (panels + forms)
In order to use the Media Library, you will need to set up a Filament custom theme for all panels that you want to use the Media Library in.
If you don't yet have a custom theme, run the following command:
Please follow the instructions in the command to finish the process and register the custom theme in the panel providers that you want to use the package in.
Next, open up the theme.css file for the custom theme and add the following line:
You should also add this line to any CSS files that you are using if you are planning to use the Media Library outside a Filament panel. You might need to correct the number of ../ to reach the vendor directory depending on where your CSS file is located.
Register plugin (only for panels)
Next, for each of the panels that you want to use the Media Library in, you will need to register the plugin in the panel provider:
Configure driver
Next, proceed to the configuration of the driver that you intend to use:
- Media Library Item-driver (default): storing media items is as easy as storing just a single ID, based on Spatie Media Library (instructions).
- Storage/disk-driver: let the Media library run on any filesystem disk supported by Laravel (instructions).
- Spatie Media Library driver: ideal for pre-existing Spatie Media Library libraries (coming soon).
- Custom driver: create your own driver to fit your specific needs (instructions).
Publishing translations
If wanted, you can publish the translations using the following command:
Installing in GitHub Actions
If you want to install the Media Library during your GitHub Actions workflow, you can add the following line to your workflow file just before the composer install command:
Next, add the following two GitHub Actions secrets to your repository (Settings > Secrets and variables > Actions > New repository secret):
FILAMENT_MEDIA_LIBRARY_USERNAME: which is your e-mailFILAMENT_MEDIA_LIBRARY_PASSWORD: which is your license key
Installing on Laravel Cloud
As Laravel Cloud does not support a global auth.json or a UI-based way to add private package credentials, the current solution is to add the following line to your deployment script, replacing {username} and {password} with your actual credentials:
Installing on Laravel Forge
Installing on Laravel Forge can be done in two ways. The simplest way is on first deploy to SSH to your server, run composer install, enter the required credentials and select yes when asked to save them in the global auth.json file. The other option is to go to {server} > PHP > Composer > Add credential in Forge. Here, enter the following details:
- Repository:
satis.ralphjsmit.com(note: do not prefix with https://) - Username: which is your e-mail
- Password: which is your license key
Changing the email associated with your license key
If you need to change the email associated with your license key, please send an e-mail to support@ralphjsmit.com.
Changelog
You can view the changelog and/or subscribe for email updates on the Filament Plugins page. You can sign in using your license e-mail and a magic link, after which you can go to your plugin, click on the Gear icon > Changelog.