⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
stores.dev-unit.com
/
vendor
/
botble
/
assets
/
View File Name :
README.md
# Laravel Assets management [](https://github.com/botble/laravel-assets/releases) [](LICENSE.md) [](https://scrutinizer-ci.com/g/botble/laravel-assets) [](https://styleci.io/repos/154250020) [](https://packagist.org/packages/botble/assets) [](https://codeclimate.com/github/botble/laravel-assets/maintainability) ## Installation ```bash composer require botble/assets ``` For version <= 5.4: Add to section `providers` of `config/app.php`: ```php // config/app.php 'providers' => [ ... Botble\Assets\Providers\AssetsServiceProvider::class, ]; ``` And add to `aliases` section: ```php // config/app.php 'aliases' => [ ... 'Assets' => Botble\Assets\Facades\AssetsFacade::class, ]; ``` All assets resource will be manage in config file so we need to publish config to use. ```bash php artisan vendor:publish --provider="Botble\Assets\Providers\AssetsServiceProvider" --tag=config ``` Add to your master layout view, in `head` tag: ```php {!! \Assets::renderHeader() !!} ``` and before `body` tag close: ```php {!! \Assets::renderFooter() !!} ``` ## Methods ### Add scripts ```php \Assets::addScripts(['key-of-assets-in-config-file']); ``` Example: ```php \Assets::addScripts(['app', 'bootstrap', 'jquery']); ``` ### Add styles ```php \Assets::addStyles(['key-of-assets-in-config-file']); ``` Example: ```php \Assets::addStyles(['bootstrap', 'font-awesome']); ``` ### Remove scripts ```php \Assets::removeScripts(['key-of-assets-in-config-file']); ``` Example: ```php \Assets::removeScripts(['bootstrap']); ``` ### Remove styles ```php \Assets::removeStyles(['key-of-assets-in-config-file']); ``` Example: ```php \Assets::removeStyles(['font-awesome']); ``` ### Others - Set version for assets. Add to `.env` ```bash ASSETS_VERSION=1.0 ``` Then all assets will be added `?v=1.0` - Change to online mode ```bash ASSETS_OFFLINE=false ``` Then assets will be loaded from CDN if it's defined in config file. - To disable versioning: ```bash ASSETS_ENABLE_VERSION=false ``` ## Contributors - [Sang Nguyen](https://github.com/sangnguyenplus) - [Dinh Quoc Han](https://github.com/dinhquochan) ## License [MIT](LICENSE) © Sang Nguyen