Asset

Statamic\API\Asset


Get all Assets.

Asset::all(); // Returns AssetCollection

Get assets in a container.

Asset::whereContainer($container); // Returns AssetCollection

Get assets in a folder (and container).

Asset::whereFolder($folder, $container); // Returns AssetCollection

Get an asset by ID.

Asset::find($id); // Returns Asset

Get an asset by path.

Asset::wherePath($path); // Returns Asset

Create an asset.

This returns an instance of a AssetFactory to allow you to chain and build your asset.

Asset::create(); // Returns AssetFactory

Import using:

use Statamic\API\Asset