Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

Sharing Data in a Laravel/Vue Application

There are multiple good ways to pass data from Laravel to Vue. In a new blogpost Jesse Schutt covers all the options.

It has been helpful to think of my application as “layers” or separate sections of code each with varying responsibilities. I like to think of Laravel as the intermediary between the persistent data in the database, and the Vue components comprising the front-end of the app.

Though the boundaries between Laravel and Vue may appear unclear at the outset, the only way one can know about the other’s data is if it is explicitly passed. Blade templates implicitly know a lot about the application, but Vue operates on a different layer, so it only knows what we tell it. Fortunately, there are a number of ways to provide Vue with the data it needs.

https://zaengle.com/blog/layers-of-a-laravel-vue-application

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band. He loves waffles and butterflies.
  • Oli

    The site has been down all day.