- What is thinktomorrow/assetlibrary used for in Laravel?
- It is a Laravel package for managing uploaded assets and media files in one central library. It is built on top of spatie/laravel-medialibrary and adds extra features such as getWidth and getHeight helpers on the asset object. Use it when you want to store, organize, and retrieve images and other files consistently across a Laravel application.
- How do I install thinktomorrow/assetlibrary with Composer?
- Install it through Composer in a Laravel project, following the package README for any publish or configuration steps. Because it builds on spatie/laravel-medialibrary, you should also confirm that the medialibrary requirements and migrations are set up as documented. The installation is standard Composer-based, but always check the package's composer.json for Laravel and PHP constraints before upgrading.
- Which Laravel and PHP versions are supported by thinktomorrow/assetlibrary 0.7.4?
- The exact Laravel and PHP version constraints are defined in the package's composer.json, so verify those before installing or upgrading to 0.7.4. The context provided does not list specific version numbers. Composer will enforce the constraints during installation, and you should test on your application's Laravel and PHP versions.
- How do I configure thinktomorrow/assetlibrary in a Laravel app?
- Configuration generally follows the package README and the underlying spatie/laravel-medialibrary setup, so publish any provided config files and define your media disk options. The package is designed to fit into a typical Laravel application with minimal configuration. Review the package's config and documentation for asset library specific options before production use.
- What changed in thinktomorrow/assetlibrary 0.7.4?
- Version 0.7.4 adds getWidth and getHeight methods on the asset object and changes image dimension calculations. It also adds an exists check in deleteAsset so deletion can skip missing assets rather than always throwing. The dimension calculation change is the main risk because it may alter stored or displayed dimensions.
- Are getWidth and getHeight available for all asset types, including videos?
- The assessment flags this as an open question, so do not assume they work for every asset type. They are intended as direct dimension helpers on the asset object, but behavior for images, videos, and unsupported formats should be verified. Test the methods against the file types your application actually stores.
- Does deleteAsset still throw an exception when the asset is missing in 0.7.4?
- The 0.7.4 change adds an exists check in deleteAsset, which may mean it no longer throws when the asset is missing. The context does not specify whether it returns a boolean or simply skips deletion. Review the implementation and add tests if your code relied on exceptions for missing assets.
- How should I test an upgrade to thinktomorrow/assetlibrary 0.7.4?
- Update in a development environment and run your existing tests, focusing on asset upload, dimension retrieval, and deletion. Add targeted tests for getWidth, getHeight, and deleting non-existent assets. Then deploy to staging and compare image dimensions against production data before rolling out.
- What are the production risks of the dimension calculation change in assetlibrary 0.7.4?
- The main risk is that changed dimension calculations could silently alter stored or displayed dimensions. That may affect layouts, validation logic, or metadata that depends on width and height. Use a staging test cycle and compare dimensions against production data; if stored metadata is affected, plan a re-processing or backfill script.
- Is thinktomorrow/assetlibrary actively maintained, and what are the alternatives?
- The package appears actively maintained, with 0.7.4 being a patch release, but monitor the issue tracker for reports about dimension calculations. Its main alternative is using spatie/laravel-medialibrary directly, since assetlibrary is built on top of it and adds convenience features. Choose assetlibrary when you want the central library behavior and helpers without building those additions yourself.