25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

Create successful ePaper yourself

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

Images<br />

We'll now migrate the images, including the logo for the toolbar, <strong>and</strong> the mock<br />

data header image: $ cp ../vuebnb-prototype/logo.png<br />

./resources/assets/images/ $ cp ../vuebnb-prototype/sample/header.jpg<br />

./resources/assets/images/<br />

Let's chain on another copy method to include these in the public/images directory.<br />

webpack.mix.<strong>js</strong>: mix .<strong>js</strong>('resources/assets/<strong>js</strong>/app.<strong>js</strong>', 'public/<strong>js</strong>') .styles([<br />

'node_modules/open-sans-all/css/open-sans.css', 'node_modules/fontawesome/css/font-awesome.css',<br />

'resources/assets/css/style.css' ],<br />

'public/css/style.css') .copy('node_modules/open-sans-all/fonts', 'public/fonts')<br />

.copy('node_modules/font-awesome/fonts', 'public/fonts')<br />

.copy('resources/assets/images', 'public/images') ;<br />

We also need to ensure the view is pointing to the correct file location for the<br />

images. In the toolbar.<br />

resources/views/app.blade.php: vuebnb <br />

And in the modal.<br />

resources/views/app.blade.php: <br />

Don't forget that the headerImageStyle data property in the entry file also needs to<br />

be updated.<br />

resources/assets/<strong>js</strong>/app.<strong>js</strong>: headerImageStyle: { 'background-image':<br />

'url(/images/header.jpg)' },<br />

While not exactly an image, we'll also migrate the favicon. This can be put<br />

straight into the public folder: $ cp ../vuebnb-prototype/favicon.ico ./public

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

Saved successfully!

Ooh no, something went wrong!