0

I installed step by step from https://www.npmjs.com/package/laravel-elixir-livereload but it doesn't work.

npm install --save-dev laravel-elixir-livereload

Next, I added it to my Elixir-enhanced Gulpfile, like:

var elixir = require('laravel-elixir');
require('laravel-elixir-livereload');
elixir(function(mix) {
   mix.livereload();
});
Patrick Oscity
  • 53,604
  • 17
  • 144
  • 168
Amir Hosseinzadeh
  • 7,360
  • 4
  • 18
  • 33

1 Answers1

0

livereload needs its own script to work with. According to the laravel-elixir-livereload documentation, you must inject livereload script to your blade templates. You can inject the script in your blade templates as follows:

Check if debugging is true

@if ( Config::get('app.debug') )
  <script type="text/javascript">
    document.write('<script src="//localhost:35729/livereload.js?snipver=1" type="text/javascript"><\/script>')
  </script> 
@endif

Insert manually(For example, place the script end of body tag or head tag)

<script src="//localhost:35729/livereload.js?snipver=1" type="text/javascript"></script>
Alex
  • 8,461
  • 6
  • 37
  • 49