class Frontend implements ExtenderInterface
Methods
Add a directory of JavaScript files to include in the JS assets public directory.
Add a route to the frontend.
Modify the content of the frontend.
Register a new title driver to change the title of frontend documents.
Details
at
line 44
__construct(string $frontend)
at
line 80
Frontend
jsDirectory(string $path)
Add a directory of JavaScript files to include in the JS assets public directory.
Primarily used to copy JS chunks.
at
line 100
Frontend
route(string $path, string $name, callable|string|null $content = null)
Add a route to the frontend.
at
line 113
Frontend
removeRoute(string $name)
Remove a route from the frontend.
This is necessary before overriding a route.
at
line 132
Frontend
content(callable|string|null $callback, int $priority = 0)
Modify the content of the frontend.
at
line 162
Frontend
preloads(callable|array $preloads)
Adds multiple asset preloads.
The parameter should be an array of preload arrays, or a callable that returns this. A preload array must contain keys that pertain to the `<link rel="preload">` tag. For example, the following will add preload tags for a script and font file: ``` $frontend->preloads([ [ 'href' => '/assets/my-script.js', 'as' => 'script', ], [ 'href' => '/assets/fonts/my-font.woff2', 'as' => 'font', 'type' => 'font/woff2', 'crossorigin' => '' ] ]); ```
at
line 174
Frontend
title(string $driverClass)
Register a new title driver to change the title of frontend documents.
at
line 205
Frontend
extraDocumentClasses(string|array|callable $classes)
Adds document root classes.
Can either be a string or an array of strings. An array can be of a format acceptable by the @class blade directive.