Get versioned Laravel Elixir file paths in WordPress.
To use this plugin you need to setup your WordPress installation via a Composer setup like Bedrock. Then you can install it via:
$ composer require sourceboat/wp-laravel-elixir
This plugin exposes the elixir('path/to/file.ext')
helper method, known from the Laravel Framework. It expects your files in the dist
directory of the active theme.
You can use the helper method like this:
add_action('wp_enqueue_scripts', function () {
wp_register_style('main-css', elixir('css/main.css'), null, null);
wp_enqueue_style('main-css');
wp_register_script('main-js', elixir('js/main.js'), null, null, true);
wp_enqueue_script('main-js');
});