- How do I install brackets/media in a Laravel application?
- Install it with composer require brackets/media, then publish the package config and migrations and run php artisan migrate. Register the service provider if your Laravel version does not auto-discover it, add the package trait to the Eloquent model that should own media, and set a default filesystem disk in the config file. A realistic first working integration on a single model is one to three days for a competent Laravel developer, including verification of the version constraints.
- Which Laravel and PHP versions does brackets/media support?
- The package's last release was on 2023-10-30, which predates Laravel 11 and Laravel 12, so you must read composer.json before assuming compatibility. Check the declared illuminate/support and php constraints against your target framework version and confirm it installs cleanly in a scratch project. If the constraints pin older Illuminate releases, adopting it on a modern Laravel version means maintaining a fork from day one.
- Does brackets/media work with Laravel 11 or Laravel 12?
- There is no public evidence of this package running against Laravel 11 or 12: it has very low adoption, zero dependents, and no issue traffic or tutorials documenting newer versions. The first integration task is therefore compatibility verification rather than coding, starting with the composer.json constraints and a test install. If the constraints block installation, plan for a fork or choose a more actively maintained alternative.
- How do I attach an uploaded file to an Eloquent model with brackets/media?
- You add the package trait to your model and then call the fluent media API with the uploaded file, optionally specifying a collection name and disk. The package stores the file on the configured Laravel filesystem disk and records the association in its own table, so your existing model and migrations stay untouched. Because it hooks into the persistence layer via a trait, it fits a standard monolith or modular app without forcing a new abstraction.
- Can brackets/media store files on S3 or a custom filesystem disk?
- Yes. Storage goes through Laravel's filesystem abstraction, so any disk defined in config/filesystems.php, including local, S3, or a custom driver, can be used. You configure the default disk in the package config and can typically override it per media item. Note that path generation, filename sanitisation, deduplication, and cleanup behaviour are not publicly audited, so review the source if you rely on private disks or strict naming rules.
- Does brackets/media generate image conversions or thumbnails?
- The package advertises conversions as part of its media management feature set, but with a single 2023 release and no community documentation, the scope and reliability of derivative generation are unproven. If your product depends on responsive images, on-the-fly transformations, or queued conversion pipelines, this is a gap to verify in source before committing. Teams needing mature conversion support typically look at spatie/laravel-medialibrary instead.
- What happens to files when a model is deleted or soft-deleted?
- Cleanup behaviour on model deletion, soft deletion, and orphaned files is not documented publicly and should be treated as unaudited. Read the trait and event hooks in the source to confirm whether files are removed from disk, whether soft deletes retain media, and whether a cleanup job exists. If cascade deletion is not handled, you will need to implement your own observer or scheduled pruning command.
- How does brackets/media compare to spatie/laravel-medialibrary?
- Both occupy the same slot: ergonomic file attachment for Eloquent models. Spatie's package has thousands of stars, broad production adoption, responsive images, conversions, and queue integration, while brackets/media has a much smaller footprint and effectively no public corroboration. The honest framing is that brackets/media is a lightweight, fluent attachment helper rather than a media management platform. If your team already standardises on Spatie, adding this package creates two competing file models.
- Is brackets/media actively maintained and safe for production?
- It appears to be maintained by a single agency account for its own needs, with nine stars, zero dependents, and no security disclosure history or issue traffic. That means latent bugs or vulnerabilities would go unreported, and breakage would be discovered by your team rather than a community. Before adopting it in production, ask the maintainers about their maintenance commitment, whether they accept pull requests, and whether a licence transfer is possible.
- How do I migrate existing file path columns to brackets/media?
- Assume legacy applications store paths in string columns. Build a backfill command that reads those columns and creates media records, dual-write during a transition window so new uploads go through the package while legacy columns stay populated, then flip reads to the package, verify, and finally drop the old columns. Avoid a big-bang migration on user-generated content without a rollback plan, since the files themselves are the hard part to restore.