Download the PHP package visuellverstehen/statamic-asset-atlas without Composer
On this page you can find all versions of the php package visuellverstehen/statamic-asset-atlas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-asset-atlas
Asset Atlas
Track where your Statamic assets are used to make moving, replacing and deleting assets quick and easy.
Requirements
This package is based on using a database. It doesn't matter if you use the database for Statamic or not, but AssetAtlas tracks all asset references in entries, terms, global-sets and users as database records. This can be a simple SQLite database as it is preset in current Laravel installations.
How to use
Install the package:
Publish and run the required migration:
Now whenever you save an item that relates to an asset, the reference is tracked in AssetAtlas. On moving, deleting or replacing an asset, AssetAtlas provides all references to the asset instead of the base Statamic logic of checking all possible items.
You can (and should) initialise the atlas using this command:
As records will be updated, you can use this command regularly to keep AssetAtlas up to date. Note that this command currently doesn't remove unused references. However, you can clear the atlas before scanning by using the reset parameter:
Working copies
If a collection has revisions enabled, AssetAtlas also tracks the assets used in working copies, including assets that only the working copy uses. Moving, replacing or deleting an asset updates the working copy together with its entry. Run php please asset-atlas:scan once after updating, so existing working copies get indexed.
Working copy references are stored with the item type working_copy. AssetAtlas::find() without an item type returns them too, so an entry can appear twice there. findAll() deduplicates by item and includes entries referenced only by a working copy. findEntries() ignores working copies.
Statamic versions
AssetAtlas supports Statamic 5 only. Support for Statamic 6 is not planned.
More about us
At visuellverstehen we create innovative digital and design solutions with a special focus on the common good. With technical expertise, high creativity and strategic skills, we develop products with a personal character.
License
The MIT license (MIT). Please take a look at the license file for more information.