Looking to hire Laravel developers? Try LaraJobs

concrete5-laravel-mix maintained by kaapiii

Description
Add versioned Laravel Mix files (based on your mix-manifest.js) to concrete5 themes and packages
Last update
2020/07/22 08:24 (dev-master)
License
Links
Downloads
43

Comments
comments powered by Disqus

Load (versioned) laravel mix assets easily in concrete5.

Actions Status Latest Stable Version Total Downloads License

Provides wrapper methods for loading easily versioned laravel mix assets in concrete5 packages (and themes).

Installation

  1. Require library with composer
    composer require kaapiii/concrete5-laravel-mix

How does it work

Let's assume your mix-manifest.json contains following assets:

{
    "/dist/css/main.css": "/dist/css/main.css?id=fd593dbed17d9fd9391f",
    "/dist/js/main.js": "/dist/js/main.js?id=c833b937dc546bf8c034"
}

By adding the following snippet to your head.php or footer.php or any php file...

<?php $mix->printAsset('/dist/css/main.css') ?>
<?php $mix->printAsset('/dist/js/main.js') ?>

we get the following output (with cache busting).

<link type="text/css" rel="stylesheet" href="/dist/css/main.css?id=fd593dbed17d9fd9391f" />
<script src="/dist/js/main.js?id=c833b937dc546bf8c034"></script>

Testing

Unit tests can be run by executing github workflows/actions locally with nektos/act and this command.

act -P ubuntu-latest=shivammathur/node:latest

Or with ...

composer run-script test