I'm working on an laravel project. There're a lot of vue components and I need to make SSR due to SEO. I can't use nuxt.js or something like it because of my app is not SPA. I have default mix settings:
const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.sass', 'public/css');
mix.disableSuccessNotifications();
I put the vue components to laravel views (blade templates) like <example-component></example-component>
. How may I implement SSR for there components only in this case?
I need to add this components as rendered html to the response, not as <example-component></example-component>
due to SEO.
Server side rendering is not a one liner, but there are a package for laravel to do it, please check it out:
https://github.com/spatie/laravel-server-side-rendering
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With