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

miwal's avatar
Level 11

Choosing between Laravel and Vue to achieve same end?

Hi,

Having flirted with vue, which is obviously useful, and even got to the point of building a few simple SPAs with vue router and vuex, via some excellent courses on Udemy, I've realised that most of my app could, in fact, be built with hardly any javascript at all, which is how I kind of set out to do it in the first place in any case, following all that I've learnt here on laracasts.

In fact, I think I've decided to build it so it at least works in a basic form with javascript turned off. I could argue that I've wasted a lot of time starting with php then exploring how to do similar things with javascript.

What kind of personal guidelines do people use to help them to reduce the bamboozlement over multiple ways to achieve the same thing?

Obviously some things can only be achieved in javascript; but with that aside javascript can also take over large parts of what laravel does for us - so how do you choose when to stop?

I think I'm just going to be very old fashioned - if I can do it in php, then I will. That has the simple merit of being a discipline that I seem to be able to get a handle on. Then javascript is added but only under the assumption the site will still work without it, albeit be a bit less pretty (some call this 'progressive enhancement').

How do others deal with the profusion of choices available when using laravel with vue.

One position would be argue for the taking of one of two extremes: either use php anywhere you can with mere sprinkling of js on top; or the reverse, go for a full SPA and have laravel provide no web routes at all.

Is that a good way to start? It's where I am now... In saying this I have the feeling there may be a few valid 'middle roads', but I'm not entirely clear on (a) what those are and (b) how clear one can really expect to be in setting them out (e.g. use vue components but without vue router; and plenty of laravel web routes - which seems to be a natural middle way).

Not sure if any of this is all that useful but wondered if anyone had any thoughts.

Cheers Mike

0 likes
2 replies
StefanJanssen's avatar

In my portfolio website I used both VueJS and Laravel, I removed everything frontend related from Laravel and created a new side project with the VueCLI. Now I have a laravel backend for the API, and a VueJS frontend which does requests to the API.

There are multiple reasons I did it this way. First off I wanted my site to be quick to move around in. I also wanted to have the frontend and backend seperated for when I'm going to implement a new frontend system in the future. I could simply delete the frontend and start building it with Angular or ReactJS without having to change any backend code (routing for example).

I myself don't see why you want to have Vue in a project when most of it is done with PHP and the templating is done with Blade. It's something you can be confused about while developing because you will be using two somewhat similar syntaxes in one file. But then I would also have to say I've never tried it that way so I can't really say something useful about it then just a feeling I have.

1 like
miwal's avatar
Level 11

Thanks Stefan. You offer some valuable food for thought there. One point I realise from reading your reply is that removing 'everything front end related' from a laravel project would require that while web routes are removed, an api remains (obviously).

In a standard laravel project web routes are fed probably by models, but one would need to basically build out an api abstracted from them to be able to 'remove everything front end related' (i.e. so as not to end up with no functioning service at all!).

Taking a standard laravel app and building out an api to mirror the data needs of the app in preparation for replacing the front end is a refactor I haven't actually had any practice with I now realise, but you help me to see the direction that could take.

Not sure Jeffrey has done that particular refactor anywhere on Laracasts unless I'm mistaken, and I guess he may be understandably hesitant to chop laravel down to such a degree which would be fair enough given his main focus.

Cheers & thanks for the advice.

Please or to participate in this conversation.