diff --git a/readme.md b/readme.md index ece4b2a..6ead135 100644 --- a/readme.md +++ b/readme.md @@ -48,13 +48,24 @@ php artisan vendor:publish --provider="Backpack\Basset\BassetServiceProvider" ``` #### Storage Symlink -By default, Basset uses the `storage` directory to store cached assets in a directory that is publicly-accessible. So it needs you to run `php artisan storage:link` to create the symlink. The installation command will ask to run that, and to add that command to your `composer.json`. That will most likely make it work on your development/staging/production servers. If that's not the case, make sure you create the links manually wherever you need them, with the command `php artisan storage:link`. +The default disk remains `basset`, which lives under `storage/app/public`. Run `php artisan storage:link` so the cached assets are reachable from `public/`. The installer keeps the command in your composer scripts. + +If you prefer to keep cached files under `public/` instead of `storage/`, switch to the `public_basset` disk (`BASSET_DISK=public_basset`) and commit or ignore `public/basset` according to your workflow. + +### Disk Options + +| Disk | Where files live | Pros | Cons | +| --- | --- | --- | --- | +| `basset` (default) | `storage/app/public/basset` | Clean git tree; downloads happen on deploy; matches previous defaults | Needs `php artisan storage:link`; | +| `public_basset` | `public/basset` | Assets are ready to serve after deploy; can be versioned | Git noise unless ignored; | + +If you move to `public_basset`, re-run `php artisan basset:install --git-ignore` (or edit the file yourself) when you want the installer to append `public/basset` to `.gitignore`. ## Usage ### The `basset()` Helper -You can just use the `basset()` helper instead of Laravel's `asset()` helper, and point to CDNs and non-public files too. Use [Laravel's path helpers](https://laravel.com/docs/10.x/helpers#paths-method-list) to construct the absolute path to your file, then Basset will take care of the rest. +You can just use the `basset()` helper instead of Laravel's `asset()` helper, and point to CDNs and non-public files too. Use [Laravel's path helpers](https://laravel.com/docs/12.x/helpers#paths-method-list) to construct the absolute path to your file, then Basset will take care of the rest. For local from CDNs: ```blade @@ -156,13 +167,35 @@ Basset will: - on all requests, use the internalized file (using `