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

nickclicksco's avatar

Setting up Spark to be an SPA?

I'm a little bit confused by the Spark 6.0 app set up. I'm seeing Vue sprinkled all over the Spark application however why doesn't it use VueRouter out of the box? Without the VueRouter my Spark application is pretty old school with the need to use Laravel routes. Surely if you were going to use Vue then you'd most likely be building an SPA right?

Seems like it's not that easy to move Spark from Laravel routes to VueRouter. Does anybody have an example of how they changed a Spark installation from using Laravel routes to using the VueRouter?

Thanks, Nick

0 likes
1 reply
ejdelmonico's avatar

Spark is very opinionated and difficult to modify without generating a great deal of technical debt. In other words, if you modify the actual framework, you spend many extra hours troubleshooting issues with each update. I find it best to think of Spark as a complete package to use as a part of a site. Therefore, you can build a normal site around it in a way that you choose. For instance, you can build a Nuxt frontend or plain Vue and use Spark as your backend or just as a signup/dashboard area of a subscription site.

If you want to use the Vue cli with vue-router then go ahead. You won't hurt the Spark setup one bit. Just use Spark the way it was intended and build your site around it.

Please or to participate in this conversation.