Download the PHP package novinvision/laravel-assets-manager without Composer

On this page you can find all versions of the php package novinvision/laravel-assets-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-assets-manager

Laravel Assets Manager

Latest Version on Packagist

A Laravel package for managing, grouping, combining, and minifying CSS and JavaScript assets based on the current page.

فارسی: README-fa.md


Features


Requirements


Installation

Install the package using Composer:

The service provider is automatically registered by Laravel's package auto-discovery, so no manual registration is required.


Publish Configuration

To publish the package configuration file, run:

This will publish the configuration file to:

You can then customize the package settings from this file.


Configuration

After publishing the configuration file, you will have:

The package uses the following configuration key:

Merge Assets

The merge option controls whether assets should be combined and processed.

Example:

When enabled, the package automatically creates the required directories inside the configured public path.

Asset Path

The path option determines where the generated assets are stored inside the public directory.

For example:

The package will create the following directory structure:

If the configured path does not exist, the package creates it automatically.


Adding JavaScript Assets

You can add a JavaScript file using the assets_add_js() helper:

This can be used inside a Controller or a Blade Component.

For example:


Adding CSS Assets

Use the assets_add_css() helper to register a CSS file:

For example:


Grouping Assets

Both assets_add_js() and assets_add_css() accept an optional second parameter.

The second parameter is used to group assets.

For example:

And:

Both files are now registered under the bootstrap group.

You can add multiple files to the same group:

The group name can be any value that makes sense for your application.

For example:


Using Assets in Blade

After registering your assets, you can output them in your Blade layout using the following helper functions.

CSS

Add the following to the <head> section:

Example:

JavaScript

Add the following before the closing </body> tag:

Example:


Using Assets in a Controller

You can register assets directly from a Controller.

Your main Blade layout can then handle the actual output:

This keeps page-specific asset registration inside the Controller while keeping the layout clean.


Using Assets in Blade Components

Assets can also be registered directly inside a Blade Component.

For example:

If the Component is rendered on a page, its CSS and JavaScript assets will also be registered.

This is particularly useful for reusable Blade Components that have their own CSS or JavaScript dependencies.


Complete Example

Controller

Layout

View

The Controller registers the assets required by the page, while the layout is responsible for rendering them.


API

assets_add_js()

Register a JavaScript asset:

Example:


assets_add_css()

Register a CSS asset:

Example:


assets_css()

Render all registered CSS assets:


assets_js()

Render all registered JavaScript assets:


Using public_path()

The asset registration helpers expect the actual filesystem path of the asset.

For files located inside Laravel's public directory, it is recommended to use Laravel's public_path() helper.

For example:

This resolves to a filesystem path similar to:

This allows the package to locate and process the asset on the server when required.


Cache

Laravel Assets Manager includes an Artisan command for clearing cached assets.

You can see the available commands provided by the package using:

Then look for the command related to assets-manager.


License

This package is open-sourced software licensed under the MIT license.


Author

Developed by NovinVision Team

Email: [email protected]

Website: novinvision.com


Documentation


All versions of laravel-assets-manager with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version >10
matthiasmullie/minify Version >1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package novinvision/laravel-assets-manager contains the following files

Loading the files please wait ...