Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Speculant's avatar

[Laravel api + vue 3 spa + ssr] Questions about the organization of the project

Hi, I have a question about laravel api + vue spa + ssr

How to organize a project correctly? I now have a vue spa frontend and laravel api (different directories)

Right now I want to add ssr using v8js (laravel-server-side-rendering).

The site does not allow you to insert the code (

//PostController

return view('posts', [
    'posts'=> $post->get()
]);
//posts blade

{!! ssr('js/entry-server\.js')
     ->context('posts', $posts)
     ->render()[0] !!}
//Posts\.vue - post-list only, not the whole page
get data from context posts
// vue spa
<template>
      <div class="post-list" v-html="html" />
</template>

Is this the correct approach? I need to do frontend logic on the backend if the page needs a pre-renderer?

0 likes
2 replies

Please or to participate in this conversation.