2021-11-04 387次浏览

Version 2.0.0 of assets package was released improving public API for more convenient use.

Previously you had to specify assets registered as array:

$assetManager->register([\App\Assets\MainAsset::class]);

but since the case of registering multiple assets is not that common, the method now accepts a single asset class:

$assetManager->register(\App\Assets\MainAsset::class);

Additional method was added for registering multiple assets at once:

$assetManager->registerMany([
    \App\Assets\BootstrapAsset::class,
    \App\Assets\MainAsset::class,
]);