Download the PHP package ishanvyas22/asset-mix without Composer
On this page you can find all versions of the php package ishanvyas22/asset-mix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ishanvyas22/asset-mix
More information about ishanvyas22/asset-mix
Files in ishanvyas22/asset-mix
Package asset-mix
Short Description Asset Mix plugin for CakePHP
License MIT
Homepage https://github.com/ishanvyas22/asset-mix
Informations about the package asset-mix
AssetMix plugin for CakePHP
Provides integration with your CakePHP application & Laravel Mix.
This branch works with CakePHP 5.0+, see version map for more details.
❤️ Support The Development
Do you like this project? Support it by donating:


or Paypal me
Follow me
Installation
-
Install the AssetMix plugin with composer:
Via composer:
-
Load plugin using below command:
-
Generate basic Javascript, CSS & Sass scaffolding:
Note: Above command will generate scaffolding for vue, but you can generate Inertia scaffolding too.
-
Install frontend dependencies
- Using npm:
or
- Using yarn:
-
-
For development:
-
To watch changes:
- For production:
-
- Load
AssetMix
helper from the plugin into yourAppView.php
file:
Usage
After compiling your assets(js, css) with laravel mix, it creates a mix-manifest.json
file into your webroot
directory which contains information to map the files.
- To generate script tag for compiled javascript file(s):
Above code will render:
As you can see it works same as HtmlHelper. There is not need to provide full path or even file extension.
- To generate style tag for compiled css file(s):
Output:
If versioning is enabled, output will look something like below:
Generate command
The generate command is used to generate starter code for your Javascript application to get you started developing your frontend.
Get help:
Generate default scaffolding (with vue):
Above command will generate:
package.json
webpack.mix.js
assets/
css/
js/
sass/
assets/
directory is where you will store your js, css files which will compile down into your respective webroot/
directory.
Custom directory name:
You can also use custom directory name instead of default assets
directory, above command will create resources
directory where you can put your js, css, etc asset files.
Don't want to use Vue.js? Don't worry this plugin doesn't dictate on which Javascript library you should use. This plugin provides ability to quickly generate scaffolding for Vue as well as Bootstrap, and React.
Generate basic Bootstrap/jQuery scaffolding:
Generate React scaffolding:
Generate scaffolding for Inertia.js:
Generate React scaffolding inside resources
directory:
Serving CakePHP out of a Subdirectory
Please see docs/ServingFromSubdirectory
Version map
AssetMix version | Branch | CakePHP version | PHP minimum version |
---|---|---|---|
2.x | cake5 | >=5.0.0 | >=8.1 |
1.x | cake4 | >=4.0.0 | >=7.2 |
0.x | cake3 | >=3.5.0 | >=5.6 |
Changelog
Please see CHANGELOG for more information about recent changes.
Reference
To see this plugin into action you can refer to this project, which will provide more insight.
License
The MIT License (MIT). Please see License File for more information.