Waterhole creates bundles of scripts and stylesheets to reduce the number of
HTTP requests needed when loading the page. You can register your own files to
be included in these bundles.
By default, assets are added to the main bundle which is loaded on every page –
both in the forum and CP. If you want to add assets to be loaded only in the CP,
specify the bundle name as cp:
use Waterhole\Extend;
$this->extend(function (Extend\Assets\Stylesheet $stylesheets) {
$stylesheets->add(resource_path('css/styles.css'), 'cp');
});
If you have public assets like images, or scripts and stylesheets that you don't
want to include in the bundle, place them in your application's public
directory and then refer to them in your views using Laravel's asset()
function.
If you're developing an extension, use the service
provider's publishes method to publish your assets to the application's
public directory:
To link to an external asset (e.g. Google Fonts or something else from a CDN),
don't use the Stylesheet or Script extenders. Instead, use the
DocumentHead extender to
add a view to output in the <head> tag.
use Waterhole\Extend;
$this->extend(function (Extend\Ui\DocumentHead $head) {
$head->add('partials.font');
});