- Page 3 and 4:
Full-Stack Vue.js 2 and Laravel 5 B
- Page 5 and 6:
Full-Stack Vue.js 2 and Laravel 5 C
- Page 7 and 8:
Acquisition Editor Siddharth Mandal
- Page 9 and 10:
About the Reviewer Ashley Menhennet
- Page 11 and 12:
Why subscribe? Fully searchable acr
- Page 13 and 14:
Table of Contents Preface What this
- Page 15 and 16:
Key Prices Show more feature Class
- Page 17 and 18:
5. Integrating Laravel and Vue.js w
- Page 19 and 20:
Changing carousel images Single-fil
- Page 21 and 22:
Finishing touches Summary 8. Managi
- Page 23 and 24:
Migration and seed Serving static a
- Page 25 and 26:
What this book covers Building a fu
- Page 27 and 28:
What you need for this book Before
- Page 29 and 30:
Development tools Downloading the p
- Page 31 and 32:
Vue Devtools The Vue Devtools brows
- Page 33 and 34:
Hardware You'll need a computer wit
- Page 35 and 36:
Conventions In this book, you will
- Page 37 and 38:
Customer support Now that you are t
- Page 39 and 40:
Errata Although we have taken every
- Page 41 and 42:
Questions If you have a problem wit
- Page 43 and 44:
Introducing Vue.js At the time of w
- Page 45 and 46:
Installation Although Vue can be us
- Page 47 and 48:
Directives Similar to Angular, we c
- Page 49 and 50:
Components Components extend basic
- Page 51 and 52:
Single-file components A drawback o
- Page 53 and 54:
Server-side rendering Server-side r
- Page 55 and 56:
Vue Devtools Vue Devtools is a brow
- Page 57 and 58:
Vue Router Vue Router allows you to
- Page 59 and 60:
Case-study project After a whirlwin
- Page 61 and 62:
Figure 1.3. Vuebnb home page Second
- Page 63 and 64:
Code base The case-study project ru
- Page 65 and 66:
Summary In this first chapter, we d
- Page 67 and 68:
Vuebnb prototype In this chapter, w
- Page 69 and 70:
Project code Before we begin, you'l
- Page 71 and 72:
Main files Open the vuebnb-prototyp
- Page 73 and 74:
Opening in the browser To view the
- Page 75 and 76:
Page content With our environment s
- Page 77 and 78:
Data binding A simple task for Vue
- Page 79 and 80:
Mock listing While we're developing
- Page 81 and 82:
Header image No room listing would
- Page 83 and 84:
Directives Vue's directives are spe
- Page 85 and 86:
Expressions If a directive requires
- Page 87 and 88:
Arguments Some directives take an a
- Page 89 and 90:
Figure 2.6. Page including header i
- Page 91 and 92:
List rendering The v-for directive
- Page 93 and 94:
.list .list-item { flex: 0 0 100%;
- Page 95 and 96:
Prices Let's now add the price list
- Page 97 and 98:
We'll also put a button after the p
- Page 99 and 100:
Event listener We now want to remov
- Page 101 and 102:
Getters and setters To assign a val
- Page 103 and 104:
Figure 2.9. Getters and setters Vue
- Page 105 and 106:
Image modal window To prevent our h
- Page 107 and 108:
Opening First, let's add a Boolean
- Page 109 and 110:
Window Let's now add markup for the
- Page 111 and 112:
Dimming the main window We could si
- Page 113 and 114:
Vue's mount element What if we just
- Page 115 and 116:
Closing Users will need a way to cl
- Page 117 and 118:
Event modifiers Vue makes it easy t
- Page 120 and 121:
Figure 2.11. Vue.js lifecycle diagr
- Page 122 and 123:
Proxied properties You may have not
- Page 124 and 125:
Summary In this chapter, we got fam
- Page 126 and 127:
Laravel Laravel is an open source M
- Page 128 and 129:
Environment We'll be using Laravel
- Page 130 and 131:
Vuebnb In Chapter 2, Prototyping Vu
- Page 132 and 133:
folders: - map: /Users/anthonygore/
- Page 134 and 135:
$ cp .env.example .env $ php artis
- Page 136 and 137:
Database We'll be using a relationa
- Page 138 and 139:
192.168.10.10 vuebnb.test The hosts
- Page 140 and 141:
Summary In this brief chapter, we d
- Page 142 and 143:
Vuebnb room listings In Chapter 2,
- Page 144 and 145:
Figure 4.1. Vuebnb web service Web
- Page 146 and 147:
Database Our web service will requi
- Page 149 and 150:
Schema A schema is a blueprint for
- Page 151 and 152:
Execution Now that we've set up our
- Page 153 and 154:
Creating a seeder Laravel includes
- Page 155 and 156:
Inserting the data In order to inse
- Page 157 and 158:
+"price_extra_people": "No charge",
- Page 159 and 160:
Eloquent ORM Object-Relational Mapp
- Page 161 and 162:
Casting The data types in a MySQL d
- Page 163 and 164:
Public interface The final piece of
- Page 165 and 166:
Controller We'll be adding more rou
- Page 167 and 168:
Accessing images Files in the publi
- Page 169 and 170:
Image links The payload for each li
- Page 171 and 172:
Integrating Laravel and Vue.js with
- Page 173 and 174:
JavaScript JavaScript assets are ke
- Page 175 and 176:
Node modules Another key aspect of
- Page 177 and 178:
Asset compilation The files in reso
- Page 179 and 180:
Dependencies In a frontend applicat
- Page 181 and 182:
Bundling The process of resolving m
- Page 183 and 184:
Laravel Mix One of the downsides of
- Page 185 and 186:
$ webpack [options] Rather than fi
- Page 187 and 188:
JavaScript Inspecting the output Ja
- Page 189 and 190: Fonts You might think it's strange
- Page 191 and 192: Removing unnecessary dependencies a
- Page 193 and 194: Syntax clash Using the prototype te
- Page 195 and 196: JavaScript Let's now move the proto
- Page 197 and 198: Displaying modules with Webpack Let
- Page 199 and 200: In short, import Vue from 'vue' is
- Page 201 and 202: CSS To migrate CSS, we'll copy styl
- Page 203 and 204: Fonts Open Sans and Font Awesome ne
- Page 205 and 206: After building again, we'll now hav
- Page 207 and 208: Watch mode So far, we've been runni
- Page 209 and 210: Note that if you run BrowserSync in
- Page 211 and 212: Polyfills The ES2015 proposal inclu
- Page 213 and 214: Mock data We've now completely migr
- Page 215 and 216: 404.
- Page 217 and 218: Injecting data Getting the mock-lis
- Page 219 and 220: Figure 5.16. Model as a JSON string
- Page 221 and 222: Replacing the hard-coded model We n
- Page 223 and 224: Figure 5.19. How the listing model
- Page 225 and 226: Image URLs The last thing to do is
- Page 227 and 228: Figure 5.21. Images are now a data
- Page 229 and 230: Figure 5.22. Listing page with mock
- Page 231 and 232: Summary In this chapter, we got fam
- Page 233 and 234: Components When we're constructing
- Page 235 and 236: Data In addition to reusable markup
- Page 237 and 238: { images: [ '/images/1/Image_1.jpg'
- Page 239: Figure 6.3. Setting index to 2 sele
- Page 243 and 244: }); This renders as: Hi I'm comp
- Page 245 and 246: Carousel controls To allow a user t
- Page 247 and 248: Figure 6.4. Carousel controls added
- Page 249 and 250: Props We can send data to a compone
- Page 251 and 252: Dynamic props We can reactively bin
- Page 253 and 254: Figure 6.5. Image URLs are props se
- Page 255 and 256: Figure 6.6. Carousel control icons
- Page 258 and 259: Changing carousel images Returning
- Page 260 and 261: Figure 6.8. The state of the image
- Page 262 and 263: Transformation To use a single-file
- Page 264 and 265: @click="clicked">`, props: [ 'dir'
- Page 266 and 267: Figure 6.10. Inlined CSS in documen
- Page 268 and 269: Content distribution Imagine you're
- Page 270 and 271: It's important to note that con
- Page 272 and 273: Next we import ModalWindow in the e
- Page 274 and 275: Refs In its initial state, the moda
- Page 276 and 277: Header image Let's now abstract the
- Page 278 and 279: Feature lists Let's continue our pr
- Page 280 and 281: Scoped slots The FeatureList compon
- Page 282 and 283: Although this approach has just as
- Page 284 and 285: methods: { openModal() { this.$refs
- Page 286 and 287: Render functions Rather than supply
- Page 288 and 289: Refactoring the main template as si
- Page 290 and 291:
Mounting the root-level component w
- Page 292 and 293:
(production)
- Page 294 and 295:
Production builds The rows of the t
- Page 296 and 297:
Selecting a build A good build for
- Page 298 and 299:
Building a Multi-Page App with Vue
- Page 300 and 301:
Routers If you are going with an SP
- Page 302 and 303:
Special components When you install
- Page 304 and 305:
Figure 7.1. Front page of Vuebnb
- Page 306 and 307:
Creating routes The most basic conf
- Page 308 and 309:
App. This is so the toolbar is in t
- Page 310 and 311:
Home page Let's start work on our h
- Page 312 and 313:
Figure 7.5. Home page with Vue Devt
- Page 314 and 315:
Figure 7.6. Page source of vuebnb.t
- Page 316 and 317:
Figure 7.7. Completed home page, fo
- Page 318 and 319:
} Finally, we'll need to update our
- Page 320 and 321:
1 => [ ... ] ... 29 => [ ... ] ] ]
- Page 322 and 323:
"thumb" => "..." ] 1 => [ ... ] ...
- Page 324 and 325:
Figure 7.8. Vue Devtools showing th
- Page 326 and 327:
Let's declare ListingSummary within
- Page 328 and 329:
After you add that code, your listi
- Page 330 and 331:
In-app navigation If we use the add
- Page 332 and 333:
Figure 7.14. How a page decides wha
- Page 334 and 335:
*/
- Page 336 and 337:
next An important feature of naviga
- Page 338 and 339:
Home API endpoint We'll now impleme
- Page 340 and 341:
Mixins If you have any functionalit
- Page 342 and 343:
Moving the solution to a mixin Let'
- Page 344 and 345:
Linking to the listing page The abo
- Page 346 and 347:
Figure 7.16. Dev Tools console show
- Page 348 and 349:
Adding a footer To improve the desi
- Page 350 and 351:
Figure 7.19. Custom footer on home
- Page 352 and 353:
The route object The route object r
- Page 354 and 355:
Figure 7.20. Custom footer on home
- Page 356 and 357:
esources/assets/components/HomePage
- Page 358 and 359:
.listing-summaries-wrapper { overfl
- Page 360 and 361:
Translate In order to shift our lis
- Page 362 and 363:
Figure 7.23. Shifted listing groups
- Page 364 and 365:
Finishing touches There are two mor
- Page 366 and 367:
Summary In this chapter, we learned
- Page 368 and 369:
Flux application architecture Imagi
- Page 370 and 371:
Principle #1 - Single source of tru
- Page 372 and 373:
Principle #3 - Mutations are synchr
- Page 374 and 375:
Installing Vuex Vuex is an NPM pack
- Page 376 and 377:
ListingSave component Let's begin b
- Page 378 and 379:
Figure 8.7. The ListingSave compone
- Page 380 and 381:
Mutator method We created the stub
- Page 382 and 383:
Changing the icon to reflect the st
- Page 384 and 385:
Figure 8.9. The ListingSave icon wi
- Page 386 and 387:
Figure 8.10. The listing save featu
- Page 388 and 389:
Figure 8.11. The listing save featu
- Page 390 and 391:
Figure 8.12: Saved page Implementin
- Page 392 and 393:
State and mutator methods Let's add
- Page 394 and 395:
Retrieving page state from Vuex Now
- Page 396 and 397:
Getters Sometimes what we want to g
- Page 398 and 399:
to.path !== serverData.path) { axio
- Page 400 and 401:
esources/assets/components/SavedPag
- Page 402 and 403:
Toolbar links The last thing we'll
- Page 404 and 405:
Summary In this chapter, we learned
- Page 406 and 407:
User model In order to save listing
- Page 408 and 409:
Model Let's now take a look now at
- Page 410 and 411:
Seeder In a normal web app with a l
- Page 412 and 413:
Login system Now that we have our u
- Page 414 and 415:
top: 12px; padding-bottom: 12px; }
- Page 416 and 417:
Controller { use AuthenticatesUsers
- Page 418 and 419:
CSRF protection CSRF (cross-site re
- Page 420 and 421:
Post-login redirection When a user
- Page 423 and 424:
Protecting the saved route We can u
- Page 425 and 426:
auth meta property We'll begin by a
- Page 427 and 428:
Responding to authenticated state N
- Page 429 and 430:
Retrieving saved items from the dat
- Page 431 and 432:
Persisting saved listings The mecha
- Page 433 and 434:
array_search($id, $saved); if ($key
- Page 435 and 436:
AJAX request Let's now use AJAX to
- Page 437 and 438:
API authentication We added the aut
- Page 439 and 440:
Laravel Passport Laravel Passport i
- Page 441 and 442:
Summary In this chapter, we learned
- Page 443 and 444:
Heroku Heroku is a cloud platform s
- Page 445 and 446:
Creating an app Let's now create a
- Page 447 and 448:
$ heroku config:set APP_KEY=base64:
- Page 449 and 450:
Default string length At the time o
- Page 451 and 452:
Configuring a web server Web server
- Page 453 and 454:
Deployment We've done all the neces
- Page 455 and 456:
Serving static assets Since our sta
- Page 457 and 458:
KeyCDN There are many different CDN
- Page 459 and 460:
FTP_HOST=ftp.keycdn.com FTP_USER=an
- Page 461 and 462:
NPM scripts To make it easy to use
- Page 463 and 464:
Running the FTP script The first ti
- Page 465 and 466:
CDN helper Let's begin by creating
- Page 467 and 468:
... ... ...
- Page 469 and 470:
Deploying to Heroku With that done,
- Page 471:
Recap We've come a long way in this
- Page 474:
Summary In this chapter, we learned