From e807343ef44b720a96c569e87c33fdb42ca0adde Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Sat, 3 Oct 2026 15:18:03 -0400 Subject: [PATCH] Rename the quick start to Quick start guide and usage The README standard now splits the section into Getting started, the setup a fresh install needs before the first call, and Usage. Every command, tag and env key shown was checked against the package's own provider, config or CLI. --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f751c45..2a635c2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,22 @@ Requires PHP `^8.4.1 || ^8.5` and Laravel `^13.0`. composer require laranail/assets ``` -## Quick start +## Quick start guide and usage + +### Getting started + +1. Publish the config and declare each asset under `resources.scripts` or `resources.styles`; + the top-level `scripts` and `styles` lists name the ones loaded on every page. + + ```bash + php artisan vendor:publish --tag=laranail::assets-config + ``` + +2. `ASSETS_OFFLINE` defaults to `true`, which serves every asset from its `local` source. Set it to + `false` to use the `cdn` source of assets marked `use_cdn`. `ASSETS_ENABLE_VERSION=true` appends + `?v=` plus `ASSETS_VERSION` to each URL. + +### Usage ```blade {{-- resources/views/layouts/app.blade.php --}} @@ -35,6 +50,11 @@ composer require laranail/assets @php(Assets::addScriptsDirectly('js/checkout.js')) ``` +```php +// 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](docs/architecture.md); everything else is in the [documentation index](#documentation). ## Documentation