Laravel 5 Elixir Gulp LiveReload

If you are anything like me, you are having trouble getting LiveReload to work in the Elixir overlay for Gulp. Good news is, I’ve finally got it figured out and am here to share. It turns out to be really simple, you just need to create an extension for Elixir. Add this to your gulpfile.js:

Then in your HTML, include this line:

One thing you will notice is in the livereload.changed()  method, I’m passing the word localhost. If you do not pass something there (for whatever reason), you will get an error like this:

It seems to work fine with an asterisk passed there as well. Maybe somebody can comment further what should go there.

Laravel 4 Session Not Persisting

I pulled out my hair trying to get sessions to persist in Laravel 4 for quite a while. I combed over my code a hundred times and Googled until my eyes bled trying to figure it out. This was my test:

As it turns out, it had to do with my Session configuration in config/session.php. I set my cookie name to something like this:

The lesson here is DO NOT PUT PUNCTUATION IN YOUR COOKIE NAME! Once I removed the period from that cookie name, everything worked fine.

Hope that helps!