moonshine-software / moonshine

Laravel Admin panel and more. Simple for beginners and powerful for experts. Using Blade, Alpine.js and Tailwind CSS.
https://moonshine-laravel.com
MIT License
797 stars 105 forks source link

Assets prepend append #1352

Closed lee-to closed 3 days ago

lee-to commented 3 days ago

Issue #1345

Append

protected function onLoad(): void
{
   $this->getAssetManager()->append(InlineCss::make('alert(1)'));
}

Prepend

protected function onLoad(): void
{
   $this->getAssetManager()->prepend(InlineCss::make('alert(1)'));
}

Modify

protected function onLoad(): void
{
   $this->getAssetManager()->modifyAssets(function($assets) {
        sort($assets);

        return $assets;
    });
}