You're exactly right: the source of the problem is a version mismatch between the Filament Spatie Media Library Plugin and your installed Filament core packages.
filament/spatie-laravel-media-library-plugin v5.x is only compatible with Filament v5.x.
If your app is using Filament 4.x, you need to use filament/spatie-laravel-media-library-plugin v4.x.
Solution
-
Check your current Filament version
Run:
composer show filament/filamentThis will show something like
versions : * 4.x.x -
Install the matching plugin version
For Filament 4.x, install the v4 version of the plugin:
composer require filament/spatie-laravel-media-library-plugin:"^4.0"Do not use v5 of the plugin if your core Filament is v4.
Notes
- If you want to use v5 of the plugin, you'd have to upgrade Filament to v5, but this can involve breaking changes.
- The error you saw:
means it's looking for Filament 5 core packages, which do not exist in your project.filament/spatie-laravel-media-library-plugin v5.0.0 requires filament/support v5.0.0
General advice
For all Filament plugins, always check the plugin's composer.json or documentation for support matrix (which core Filament versions are compatible with which plugin versions).
Summary:
Downgrade the Filament Spatie Media Library Plugin to ^4.0 to fit your Filament 4.x installation:
composer require filament/spatie-laravel-media-library-plugin:"^4.0"
That should solve the installation conflict!