laranail/assets is not published to Packagist, so there is no registry-version badge to show: see Install.
An opinionated HTML asset manager for Laravel.
Requires PHP ^8.4.1 || ^8.5 and Laravel ^13.0.
composer require laranail/assets-
Publish the config and declare each asset under
resources.scriptsorresources.styles; the top-levelscriptsandstyleslists name the ones loaded on every page.php artisan vendor:publish --tag=laranail::assets-config
-
ASSETS_OFFLINEdefaults totrue, which serves every asset from itslocalsource. Set it tofalseto use thecdnsource of assets markeduse_cdn.ASSETS_ENABLE_VERSION=trueappends?v=plusASSETS_VERSIONto each URL.
{{-- resources/views/layouts/app.blade.php --}}
<head>
{!! Assets::renderHeader() !!}
</head>
<body>
@yield('content')
{!! Assets::renderFooter() !!}
</body>
{{-- resources/views/checkout.blade.php --}}
@extends('layouts.app')
@php(Assets::addScriptsDirectly('js/checkout.js'))// Queue assets declared under resources.* by name, from a controller or a view
Assets::addScripts(['modernizr'])->addStyles(['bootstrap']);The registered names and design are in Architecture; everything else is in the documentation index.
Full documentation is at opensource.simtabi.com/documentation/laranail/assets.
- Architecture — what this package registers, and under which names.
MIT. See LICENSE.