All writing

Safeguards for Spatie's Laravel Media Library

LaravelSpatieOpen sourcePHP

I enhanced the Spatie Laravel Media Library with several new safeguards to improve file handling.

These updates significantly improve stability and help prevent unexpected errors in your media management workflows.

  • Early failure checks

    Added early checks to handle unreadable files, preventing the system from crashing or misbehaving when files can't be opened.

  • Improved media observer resolution

    Refined the media observer resolution via the container for greater flexibility and reliability.

  • New exception handling

    Introduced a FileDoesNotExist exception to cleanly handle file-opening failures.