06.10.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Laravel Elixir 332<br />

1 <br />

Versioning Multiple Files<br />

You may pass an array to the version method to version multiple files:<br />

1 elixir(function(mix) {<br />

2 A> mix.version(['css/all.css', 'js/app.js']);<br />

3<br />

4 });<br />

Once the files have been versioned, you may use the elixir helper function to generate links to the<br />

proper hashed files. Remember, you only need to pass the name of the un-hashed file to the elixir<br />

helper function. The helper will use the un-hashed name to determine the current hashed version<br />

of the file:<br />

1 <br />

2<br />

3 <br />

BrowserSync<br />

BrowserSync automatically refreshes your web browser after you make changes to your front-end<br />

resources. You can use the browserSync method to instruct Elixir to start a BrowserSync server when<br />

you run the gulp watch command:<br />

1 elixir(function(mix) {<br />

2 A> mix.browserSync();<br />

3<br />

4 });<br />

Once you run gulp watch, access your web application using port 3000 to enable browser syncing:<br />

http://homestead.app:3000. If you’re using a domain other than homestead.app for local development,<br />

you may pass an array of options¹⁷⁸ as the first argument to the browserSync method:<br />

¹⁷⁸http://www.browsersync.io/docs/options/

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!