Skip to content

AssetRegistry ​

php
final class Zairakai\LaravelBladeComponents\AssetRegistry

Remembers which scripts and styles the rendered components need, so that a page only loads those.

A component asks for what it needs while it renders (script('dismiss')); zk-scripts and zk-styles, put after the content in the layout, print what was asked for.

Source: src/AssetRegistry.php

Constants ​

NameValueDescription
SCRIPTS['dismiss', 'copy', 'modal', 'carousel', 'countdown', 'share', 'theme', 'consent']
STYLES['carousel', 'code-group']

Methods ​

script() ​

php
public function script(string ...$names): void

scripts() ​

php
public function scripts(array $also = []): string

The code of the scripts that were asked for, plus the given ones ("all" for every one of them).

style() ​

php
public function style(string ...$names): void

styles() ​

php
public function styles(array $also = []): string

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.