2 years ago

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

Posted 2 years ago by lewebdalex

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,

Please sign in or create an account to participate in this conversation.