Download the PHP package roumen/asset without Composer
On this page you can find all versions of the php package roumen/asset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package asset
rumenx/php-assets
Framework-agnostic PHP package to manage frontend assets in the backend. Works with plain PHP, Laravel, and Symfony (via adapters).
Features
- Add, order, and output CSS, LESS, and JS assets from PHP
- Cache busting (file or function based)
- Environment and domain support
- Laravel and Symfony integration via adapters
- 100% test coverage, static analysis, and CI
Installation
Usage Examples
Plain PHP
Laravel Integration
-
Register the service provider in
config/app.php
: -
Use the Asset class anywhere in your app:
- (Optional) Bindings are available via the Laravel container:
Symfony Integration
-
Register the bundle in your Symfony app:
- Use the Asset class in your controllers or templates:
Advanced Usage
- Add assets to specific locations:
Asset::add('file.js', 'header');
// Add JS to headerAsset::addFirst('file.js');
// Add as first assetAsset::addBefore('new.js', 'old.js');
// Insert before anotherAsset::addAfter('new.js', 'old.js');
// Insert after another
- Environment detection:
Asset::$envResolver = fn() => app()->environment();
- Custom URL generator:
Asset::$urlGenerator = fn($file, $secure) => asset($file, $secure);
Testing
Static Analysis
CI/CD
- GitHub Actions for tests, static analysis, and Codecov coverage reporting.
License
This project is licensed under the MIT License.
All versions of asset with dependencies
PHP Build Version
Package Version
The package roumen/asset contains the following files
Loading the files please wait ....