fxcjahid/laravel-assets-manager

There is no license information available for the latest version (1.2) of this package.

Easy css and js resource management in Laravel

1.2 2024-09-22 15:58 UTC

This package is not auto-updated.

Last update: 2025-03-23 18:09:16 UTC


README

Easy css and js resource management in Laravel

Install

  1. Install package
composer require fxcjahid/laravel-assets-manager
  1. Add provider in config/app.php
  Fxcjahid\LaravelAssetsManager\Providers\AssetsManagerServiceProvider::class,
  Fxcjahid\LaravelAssetsManager\Providers\AssetsBladeServiceProvider::class,

Usage

config for assets example:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Define which assets will be available through the asset manager
    | These assets are registered on the asset manager.
    |--------------------------------------------------------------------------
    */
    'all_assets'      => [
        'admin.media.css'   => ['Cdn' => 'media:admin/css/media.css'],
        'admin.product.css' => ['Cdn' => 'media:admin/css/media.css'],
        'admin.media.js'    => ['Cdn' => 'media:admin/js/media.js'],
        'admin.product.js'  => ['Cdn' => 'media:admin/js/media.js'],
    ],

    /*
    |--------------------------------------------------------------------------
    | Define which default assets will always be included in all pages
    | through the asset pipeline.
    |--------------------------------------------------------------------------
    */
    'required_assets' => [],
];

In your main blade file

 @assetsCss()

 @assetsJS()