Looking to hire Laravel developers? Try LaraJobs
This package is not available.

laravel-v8js-ssr-vue maintained by quanghung97

Description
Server side rendering JavaScript with Vuejs in your Laravel application V8js
Author
Last update
2019/06/01 06:20 (dev-master)
License
Links
Downloads
165

Comments
comments powered by Disqus

Server side rendering JavaScript with Vuejs in your Laravel application

Dependency

You must install V8js extension on PHP, If you using docker you can using php-fpm

https://github.com/quanghung97/laradock/tree/master/php-fpm

Installation

1- composer require quanghung97/laravel-v8js-ssr-vue.

2- php artisan vendor:publish --provider="Quanghung97\laravelV8jsSsrVue\LaravelSsrV8jsVueServiceProvider"

3- add config your webpack.mix.js below

mix.js('resources/js/client.js', 'public/js')
    .js('resources/js/server.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

This package will create component AppSSR.vue AppSSR.js client.js server.js ssr.blade.php

4- npm install vue-server-renderer --save

5- npm run dev

6- please change or remove some routes like '/' in routes/web.php

Example:

Route::get('/', function () { // change '/' to '/something'
    return view('welcome');
});

now you can go yourdomain and view page source have data-server-rendered="true"