u/Lelectrolux
In this archive from Sep 2015 to Sep 2026
- 5
- posts
- 1k
- comments
- 0
- media
- 3.4k
- score
Top posts
Server side events with Laravel 5.x ? Any experiences/gotchas ?
I do know about web socket, but 1/ I don't need two way and 2/ I don't want to use external services (pusher/redis) (business requirements). So I looked into server side events, looks promising, and want to give it a try. Any experience about it in Laravel. Even better with 5.3 Notification system ?...
Eager loading in Eloquent : $region->hotels->first()->region make 3 queries instead of 2 ? Why ?
Lets say i have 2 Eloquent models, Region and Hotel. Each hotel has a web page with a slug url created from region name and hotel name. public function getSlugAttribute() { return \Str::slug($this->name.'-'.$this->region->name); } In one page i have a list of hotels by regions, loaded like this : $r...
Route model binding from several url parts ?
An easy example is a multilingual news site. Each article url woud follow this pattern : /{locale}/articles/{country}/{article} Article aren't translated in every language. {article} and {country} are translated slugs. tl; dr; Is there an easy way to get a $catalog from the {locale} and {country} pa...
Is there a complete resource on what you need to know when dealing with WYSIWYG editor in backend languages ?
This is more of an open ended discussion on what you think are best practive or good ways to deal with a wysiwyg editor on backend and rendering on front. I've never found any resource that felt complete and secure (except the markdown ones but I'll need html) I've always avoided the problem by havi...
I'm a nobody in PHPLand, but I'd like to thank /u/nikic for all the good work these last few years. And even the years before.
You really pushed the language a long way. (I know, team effort, but still)
Sad to see you go, but all the best to you in LLVMLand.
I do hope the torch will be picked up by this PHP Foundation initiative.
EDIT : I kinda like that my best comment ever is thanking someone else
Obviously they think the added value doesn't outweight the cost in breaking change it would create.
Too hard of an upgrade path is how you end up with a dead/split community.
Python 2 still being used a lot today when Python 3 was released in 2008.
Vue 3 is still controversial and not that well supported by some keystone libraries 1 year later. It's not even too related to the bc breaks, mostly about option vs composition api.
The longer a project lives, the more people value stability and forward compatibility over the new hotness.
I currently have 6 projects coasting along in maintenance only mode, while I work on other things. I don't want a pain in the ass upgrade to the next LTS if I can afford it.
Before shitting on it (I dared) just for the title, it's an ironic article, which is pro php in the end.
Because the extra perf ain't worth the extra complexity and gotcha's for a lot (most even) of applications.
Long running processes are always a pain at some point. If you need it, it's great that it exists.
I don't have nearly enough traffic on the websites and internal tools that pay me to even care.
PHP can do it just fine. I might go with NodeJs if websockets are absolutely central to your app (but you can do it just fine with pusher in php) and golang if there is some heavy non web specific problems (math, thumbnail generation from video, ...). But again, PHP can do it just fine too. Don't bother learning a language just for that.
Look into redis (data cache), look into varnish (http cache), look into static storage (AWS or digital ocean spaces, for static files), look into offloading costly processes (memory or time) to queues (even better if queues run on a separate server).
Cache long computations whenever you can (sql queries especially).
Remember, bottlenecks ain't just about memory or time, but also parrallelism. Caching your fastest query, if it is done on 1k req/s, might be better than your longest if done on 5req/s. It
memory * req/sandtime * req/syou want to look at.Unless you are doing something pretty funky, 1k-5k concurrent will be dealt with easily. Even with only half of the above.