Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ Take a look at [the config file](https://github.com/Laravel-Backpack/basset/blob
- enable/disable dev mode using `BASSET_DEV_MODE=false` - this will force Basset to internalize assets even on localhost
- change the disk where assets get internalized using `BASSET_DISK=yourdiskname`
- disable the cache map using `BASSET_CACHE_MAP=false` (needed on serverless like Laravel Vapor)
- use an external CDN together with Basset using `BASSET_CDN_URL=https://yoursite.examplecdnprovider`

## Deployment

Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/FileOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function assetPath(string $path): string
$asset = $asset->after('//')->after('/')->start('/');
}

return $asset->value();
return config('backpack.basset.cdn_url') . $asset->value();
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/config/backpack/basset.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@

// use relative path
'relative_paths' => env('BASSET_RELATIVE_PATHS', true),

// Populate this to use a CDN like AWS Cloudfront with basset.
// Example: https://example.cloudfront.net
'cdn_url' => env('BASSET_CDN_URL', ''),
];