PHPackages                             diverently/laravel-mix-kirby - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. diverently/laravel-mix-kirby

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

diverently/laravel-mix-kirby
============================

Laravel Mix helper for the Kirby CMS

1.4.2(3y ago)2312.7k↓42.9%2MITPHP

Since Feb 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Diverently/laravel-mix-kirby)[ Packagist](https://packagist.org/packages/diverently/laravel-mix-kirby)[ RSS](/packages/diverently-laravel-mix-kirby/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

Laravel Mix Helper for Kirby
============================

[](#laravel-mix-helper-for-kirby)

Use the `mix` helper function to get the correct path to your versioned CSS and JS files generated by [Laravel Mix](https://github.com/JeffreyWay/laravel-mix).

Installation
------------

[](#installation)

### Download

[](#download)

Download and copy this repository to `site/plugins/laravel-mix-kirby`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/Diverently/laravel-mix-kirby.git site/plugins/laravel-mix-kirby

```

### Composer

[](#composer)

```
composer require diverently/laravel-mix-kirby

```

### Laravel Mix

[](#laravel-mix)

You should also install **Laravel Mix**, otherwise this plugin is pretty useless ;-) See the [installation guide](https://laravel-mix.com/docs/4.0/installation) for further information, though it's actually pretty straight forward:

Setup
-----

[](#setup)

In your `site/config/config.php` you can set two options to make this helper work with your specific setup:

#### `diverently.laravel-mix-kirby.manifestPath`

[](#diverentlylaravel-mix-kirbymanifestpath)

This is where the helper function will look for the manifest created by Laravel Mix.

Default: `assets/mix-manifest.json`

#### `diverently.laravel-mix-kirby.assetsDirectory`

[](#diverentlylaravel-mix-kirbyassetsdirectory)

This will be prepended to the individual file paths given to the `mix()` function when creating the final HTML tags.

Default: `assets`

Options
-------

[](#options)

### `mix()` helper function

[](#mix-helper-function)

The `mix()` helper function reads the `mix-manifest.json` file and returns the right HTML tag with the correct path to the requested file. In our example we would call it like so:

```
