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

parfaitementweb's avatar

Modern dev forces me to JS when I want to PHP.

Hi everyone,

I'm looking for your good wisdom and thoughts in those dark times I'm in.

I woke up this morning with a webapp idea. Let's say it's a Todo app because it doesn't matter here. I opened a blank new Laravel project and start working on.

I was at the part where I wanted to render a list of items. Classic PHP dev thinks : render and foreach. But those items will be movable, removable, updatable, the classic dynamic stuffs. So, I agree, let's throw a Vue component in there and handle those behaviours.

One hour later, I'm in this huge VueJs-ES2015-Axios-Lodash-Webpack source code in order to render my todo list and editing its items.

At this point it hits me : Laravel does exactly only one thing in my app: CRUD.

Even all GroupingBy, OrderingBy, Sorting, etc. which can be done in seconds with Eloquent queries has to be handled by the JS now. Here comes the JS _.groupBy _.map, etc.

I'm really sad and do not know what to think. All those things I can do under Laravel and PHP in seconds have to be done in JS now because once your Todo list items are fetched at the beginning with an Ajax call, you don't have a lot of option than sticking to JS.

JS is great and inevitable. But I'm really asking myself if Laravel (and then PHP) is going to be "backend/api only".

What's your point on this? Help me keeping faith. Cheers,

0 likes
9 replies
jekinney's avatar

Lol, just was debating this at work today.

Company I work at, they want to add a discussion board for the first app. Same questions as yours came up. The frontend devs use react. So they just want an API, backend devs say it's not really built for that (one feature API driven). But backend guys where stating the same thing. What's the next few years going to be? All API?

To be honest, it depends per app but definitely looks like it generally will be API driven backends.

Most large sites like Google (not just search), Facebook, twitter, Yahoo and Yahoo mail, LinkedIn etc are all API backend.

At a very fundamental and basic level vue router just changes the URL and remove/replace components. Basically a spa but allows for requests on component load versus a more traditional all data at once.

pmall's avatar

Whats so different in making an api or an html app? Returning json instead of html?

But I agree, I don't like all this JS thing. I usually try to put the less possible javascript in my apps, just the minimum required. It ends up in multiple pages with some javascript component into it.

Look at this successful laracast website for example, it is perfectly fine and it is not api/js only.

primordial's avatar

@lewebdalex I think the days of a fully integrated monolith are numbered. They are quick and dirty solution by comparison. However, there are still a lot of hills to climb. I believe isomorphic javascript is the next immediate headache.

http://isomorphic.net/

ohffs's avatar

I'm sticking with fully integrated monoliths on the assumption they'll come back into fashion at some point ;-) I also know Cobol, if anyone's hiring.... ;-)

I try to keep the JS I use to a minimum. The last little project I did pulled in jq/datatables to make filtering some tables a bit easier - but other than that had no js involved at all. I sometimes watch videos of people doing modern JS stuff and seeing all the babel/gulp/node/whatever - 100mb of node_modules, build scripts, etc - and the end result often seems to be that you have one script tag instead of two or three. So you possibly save a few ms on tcp handshakes - but I kind of "don't get it" really.

primordial's avatar

Ahh bugger @ohffs Now I'm fighting the urge to waste a couple of hours on that repo.

I withdraw my previous comments. Lets all build monoliths starting at column 7.

dawiyo's avatar

I struggle with this in my field. My end users are 99% of the time going to be on IE, a DSL-like connection, and a very good chance they have JS disabled. I ran a Laravel and Angular app for a while, but my users kept complaining about slow load times, etc. Back to Blade for me.

ohffs's avatar

@primordial

Lets all build monoliths starting at column 7

You've no idea how much that made me giggle ;-)

Please or to participate in this conversation.