Is Laravel Broadcasting suitable for real-time online game?
I struggle to understand how multiplayer online games work with WebSockets. I've always thought that they keep one connection open for both sides of the communication - sending and receiving, so the latency is as minimal as possible.
However, Laravel seems to suggest sending messages via WebSockets through axios or fetch API, which is where I'm confused. Isn't creating new HTTP requests considered slow? There is a lot going on to dispatch a request, bootstrap the app etc. Doesn't it kill all the purpose of WebSocket connection, which is supposed to be almost real-time?
Is PHP a suboptimal choice for real-time multiplayer games in general? Do some other languages or technologies keep the app open in memory, so HTTP requests are not necessary? It's really confusing to me, because I haven't seen any tutorials using Broadcasting without axios or fetch.
How do I implement a game that, for example, stores my action in a database and sends it immediately to other players?
https://redd.it/1j64tak
@r_php
I struggle to understand how multiplayer online games work with WebSockets. I've always thought that they keep one connection open for both sides of the communication - sending and receiving, so the latency is as minimal as possible.
However, Laravel seems to suggest sending messages via WebSockets through axios or fetch API, which is where I'm confused. Isn't creating new HTTP requests considered slow? There is a lot going on to dispatch a request, bootstrap the app etc. Doesn't it kill all the purpose of WebSocket connection, which is supposed to be almost real-time?
Is PHP a suboptimal choice for real-time multiplayer games in general? Do some other languages or technologies keep the app open in memory, so HTTP requests are not necessary? It's really confusing to me, because I haven't seen any tutorials using Broadcasting without axios or fetch.
How do I implement a game that, for example, stores my action in a database and sends it immediately to other players?
https://redd.it/1j64tak
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
DAE get frustrated when searching for a Composer package for "foo" and only find "laravel-foo"?
I get that many people use Laravel, but like myself, many don't. I'd much rather use independent packages that are not wired in to illuminate or whatever. Why not make an independent package for the functionality, and then add a bridge/wrapper for Laravel? That way you can support many frameworks if you so choose.
https://redd.it/1j67jov
@r_php
I get that many people use Laravel, but like myself, many don't. I'd much rather use independent packages that are not wired in to illuminate or whatever. Why not make an independent package for the functionality, and then add a bridge/wrapper for Laravel? That way you can support many frameworks if you so choose.
https://redd.it/1j67jov
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Whats your approach for realtime applications on shared hosts
When it comes to realtime web applications, its always things like ReactPHP, or nodejs based websocket, or similar tools that are not really an option on shared hosts.
The next obvious thing would be SSE, but because of the usual low php process limit, this isnt an option as well if youre not the only person using the application...
So I'm curious what do others use? Is a 3rd party tool like pusher the only option?
https://redd.it/1j6eqae
@r_php
When it comes to realtime web applications, its always things like ReactPHP, or nodejs based websocket, or similar tools that are not really an option on shared hosts.
The next obvious thing would be SSE, but because of the usual low php process limit, this isnt an option as well if youre not the only person using the application...
So I'm curious what do others use? Is a 3rd party tool like pusher the only option?
https://redd.it/1j6eqae
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
How to Strangle your Project with Strangle Anti-Pattern
https://getrector.com/blog/how-to-strangle-your-project-with-strangle-anti-pattern
https://redd.it/1j6icv2
@r_php
https://getrector.com/blog/how-to-strangle-your-project-with-strangle-anti-pattern
https://redd.it/1j6icv2
@r_php
Getrector
How to Strangle your Project with Strangle Anti-Pattern
Nearly half of the projects we help upgrade have tried the upgrade before on their own.
They've introduced the infamous "strangle pattern". It's a way to upgrade a project separating one part of the codebase from the rest at a time.
Those companies reach…
They've introduced the infamous "strangle pattern". It's a way to upgrade a project separating one part of the codebase from the rest at a time.
Those companies reach…
LarAgent v0.2.0 Released
Hello, Laravel devs! Just released a new version with updates:
* Support for Laravel 12
* Dynamic model setting
* New command for batch cleaning of chat histories `php artisan agent:chat:clear AgentName`
Check the release notes here:
[https://github.com/MaestroError/LarAgent/releases/tag/0.2.0](https://github.com/MaestroError/LarAgent/releases/tag/0.2.0)
https://redd.it/1j6jbmc
@r_php
Hello, Laravel devs! Just released a new version with updates:
* Support for Laravel 12
* Dynamic model setting
* New command for batch cleaning of chat histories `php artisan agent:chat:clear AgentName`
Check the release notes here:
[https://github.com/MaestroError/LarAgent/releases/tag/0.2.0](https://github.com/MaestroError/LarAgent/releases/tag/0.2.0)
https://redd.it/1j6jbmc
@r_php
GitHub
Release 0.2.0 · MaestroError/LarAgent
What's new in LarAgent?
Support for Laravel 12
Dynamic model setting via chainable withModel and overridable model methods
New command for batch cleaning of chat histories php artisan agent:ch...
Support for Laravel 12
Dynamic model setting via chainable withModel and overridable model methods
New command for batch cleaning of chat histories php artisan agent:ch...
🚀 Laravel 12 – The Future of Laravel? Controversy, Starter Kits & Laravel Cloud!
https://youtu.be/yDNqi2EZ2Uo
https://redd.it/1j6mxvd
@r_php
https://youtu.be/yDNqi2EZ2Uo
https://redd.it/1j6mxvd
@r_php
Laravext Starter Kits for Laravel
I'm happy to announce the new Laravext Starter Kits, based on Laravel 12's starter kits with Shadcn, powered by Laravext's file-based routing system, for those who enjoy building your application in the "traditional API way".
Check out the video: https://youtu.be/wrhCLKdYgIE
or the docs at https://laravext.dev
or maybe my first post about Laravext in this subreddit: https://www.reddit.com/r/laravel/comments/1ewnfd3/im\_happy\_and\_nervous\_to\_announce\_my\_first\_and/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button
https://redd.it/1j6nsew
@r_php
I'm happy to announce the new Laravext Starter Kits, based on Laravel 12's starter kits with Shadcn, powered by Laravext's file-based routing system, for those who enjoy building your application in the "traditional API way".
Check out the video: https://youtu.be/wrhCLKdYgIE
or the docs at https://laravext.dev
or maybe my first post about Laravext in this subreddit: https://www.reddit.com/r/laravel/comments/1ewnfd3/im\_happy\_and\_nervous\_to\_announce\_my\_first\_and/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button
https://redd.it/1j6nsew
@r_php
YouTube
Laravext Starter Kits for Laravel 12 (with Shadcn)
This is the introduction to Laravext's new starter kits that use Laravel 12 and Shadcn, which are based on Laravel 12's new starter kits.
For more details, check the documentation at:
https://laravext.dev
#laravel #laravext #vue #react #nextjs #inertiajs…
For more details, check the documentation at:
https://laravext.dev
#laravel #laravext #vue #react #nextjs #inertiajs…
A humble request (Part 1) - Symfony vs Laravel
https://medium.com/@paulclegg_18914/symfony-vs-laravel-a-humble-request-part-1-412f41458b4f
https://redd.it/1j6sjib
@r_php
https://medium.com/@paulclegg_18914/symfony-vs-laravel-a-humble-request-part-1-412f41458b4f
https://redd.it/1j6sjib
@r_php
Medium
Symfony vs Laravel: A humble request (Part 1)
If you’re reading this article you’ve likely already heard of Symfony and Laravel.
Regexp class in SPL
Anyone else ever lament that PHP doesn't have a
Instead, we always have to deal with patterns as strings, which can be annoying:
It would be especially helpful in configuration, where there can often be something like
Woudln't it be great if there were a SPL
Curiously, `RegexIterator` exists, but not something simpler for a single expression.
https://redd.it/1j6n2wc
@r_php
Anyone else ever lament that PHP doesn't have a
Regexp class in its std lib (e.g. Ruby, JS) to represent a regular expression and associated flags?Instead, we always have to deal with patterns as strings, which can be annoying:
It would be especially helpful in configuration, where there can often be something like
MyConfig::$match: string that can be handled as an exact match or regex pattern. With them both as strings, we often have to resort to additional configuration, e.g. MyConfig::$exactMatch: bool. And even with that, it doesn't provide anywhere to configure regex flags.Woudln't it be great if there were a SPL
Regexp object, so we could just have MyConfig::$pattern: string|\Regexp?Curiously, `RegexIterator` exists, but not something simpler for a single expression.
https://redd.it/1j6n2wc
@r_php
A Week of Symfony #949 (3-9 March 2025)
https://symfony.com/blog/a-week-of-symfony-949-3-9-march-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1j73nye
@r_php
https://symfony.com/blog/a-week-of-symfony-949-3-9-march-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1j73nye
@r_php
Symfony
A Week of Symfony #949 (March 3–9, 2025) (Symfony Blog)
This week, the upcoming Symfony 7.3 version renamed the JsonEncoder component to JsonStreamer, added support for Valkey schemes in the Cache component and introduced a field_id() form helper.
What do you think about this 8 hour long Laravel "ad"?
https://www.youtube.com/watch?v=a1cWkClBXLI
https://redd.it/1j74blv
@r_php
https://www.youtube.com/watch?v=a1cWkClBXLI
https://redd.it/1j74blv
@r_php
YouTube
Launching a site in one day... WITH PHP?
Twitch https://twitch.tv/ThePrimeagen
Discord https://discord.gg/ThePrimeagen
Laravel Cloud is a great way to actually ship something (not that we would know) - Check out this awesome way to ship ship ship! lrvl.co/topshelf
Sentry is a great way to track…
Discord https://discord.gg/ThePrimeagen
Laravel Cloud is a great way to actually ship something (not that we would know) - Check out this awesome way to ship ship ship! lrvl.co/topshelf
Sentry is a great way to track…
Laravel Package Directory
Ever found a useful package and wished more people knew about it? Now you can submit it to Indxs.dev, where developers explore and discover great tools.
Right now, we have three indexes:
✅ PHP
✅ Laravel
✅ Filament
If you know a package that deserves a spot, go ahead and add it. Let's make it easier for devs to find the right tools!
https://indxs.dev
https://redd.it/1j77dqn
@r_php
Ever found a useful package and wished more people knew about it? Now you can submit it to Indxs.dev, where developers explore and discover great tools.
Right now, we have three indexes:
✅ PHP
✅ Laravel
✅ Filament
If you know a package that deserves a spot, go ahead and add it. Let's make it easier for devs to find the right tools!
https://indxs.dev
https://redd.it/1j77dqn
@r_php
indxs.dev
Indxs - Explore Open Source Packages
Find the best Laravel and PHP packages.
Weekly /r/Laravel Help Thread
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1j7c1k4
@r_php
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1j7c1k4
@r_php
Laravel
Installation - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
[Update] Laravel AI Translator: Now with Extended Thinking, Crowdin Support, and Beautiful Terminal UI
Hey Laravel folks! Remember that AI translation package I shared a while back? Well, I've been busy cooking up some major improvements, and I'm excited to share what's new.
# The Big One: Context makes your website feel like local website
The biggest game-changer in this update is how we handle translation context. Now, when translating any string, the AI sees EVERYTHING - all previously translated strings and all source strings across ALL your files. This means your translations stay incredibly consistent. No more "Login" being translated five different ways across your app.
Example terminal output showing the context loading:
ℹ Loading reference: ko_KR - 9 files
ℹ Using context: 10 files, 71 items
# Gorgeous Terminal UI
The terminal output got a serious glow-up. It's not just pretty - it's informative as hell. You get:
* Real-time progress for each translation
* Token usage tracking (yes, you can see exactly how much each translation costs)
* Color-coded status indicators
* Detailed file processing information
Here's a snippet of what it looks like now:
File Translation
File: profile.php
Language: ko_KR
Source: lang/en/profile.php
Target: lang/ko_KR/profile.php
⏺ Processing chunk 1/2 (50 strings)
ℹ Using context: 10 files, 71 items
🧠 AI Thinking...
⟳ profile.matches.columns.deaths → 죽음
⟳ profile.matches.columns.knocked → 넉다운
Tokens: Input=2193, Output=3, Total=2196
[Example of extended thinking](https://preview.redd.it/xvzbrtt8mpne1.png?width=2034&format=png&auto=webp&s=879517ffeb75137450df78aa04849ce3ec6e1cb3)
https://preview.redd.it/qho3zfjhmpne1.png?width=2572&format=png&auto=webp&s=fcaeaeddfe76afd93622777ca83b00fd52282bc5
# Claude 3.7 Sonnet with Extended Thinking
We're now leveraging Claude 3.7's Extended Thinking capabilities. This means:
* Massive 200K token context window
* Up to 64K output tokens
* Better reasoning for complex translations
* More natural and contextually aware translations
# Surprise Feature: Crowdin Integration (Beta)
Here's something cool - you can now translate your Crowdin projects directly! And it's not just for Laravel - it works with ANY project on Crowdin. Want to know how? Drop a comment, and I'll share the details.
# Complete Code Overhaul
I basically rewrote the entire thing. The codebase is now:
* More maintainable with dedicated service classes
* Better organized with clear separation of concerns
* More efficient with optimized API calls
* More robust with improved error handling
# Want to Try It Out?
Check out the package: [kargnas/laravel-ai-translator](https://github.com/kargnas/laravel-ai-translator)
Let me know if you have any questions or run into issues. I'm actively maintaining this and would love your feedback!
P.S. If you're using the previous version, you might want to update - the consistency improvements alone are worth it.
P.S. Look at the default config file!
https://redd.it/1j7efct
@r_php
Hey Laravel folks! Remember that AI translation package I shared a while back? Well, I've been busy cooking up some major improvements, and I'm excited to share what's new.
# The Big One: Context makes your website feel like local website
The biggest game-changer in this update is how we handle translation context. Now, when translating any string, the AI sees EVERYTHING - all previously translated strings and all source strings across ALL your files. This means your translations stay incredibly consistent. No more "Login" being translated five different ways across your app.
Example terminal output showing the context loading:
ℹ Loading reference: ko_KR - 9 files
ℹ Using context: 10 files, 71 items
# Gorgeous Terminal UI
The terminal output got a serious glow-up. It's not just pretty - it's informative as hell. You get:
* Real-time progress for each translation
* Token usage tracking (yes, you can see exactly how much each translation costs)
* Color-coded status indicators
* Detailed file processing information
Here's a snippet of what it looks like now:
File Translation
File: profile.php
Language: ko_KR
Source: lang/en/profile.php
Target: lang/ko_KR/profile.php
⏺ Processing chunk 1/2 (50 strings)
ℹ Using context: 10 files, 71 items
🧠 AI Thinking...
⟳ profile.matches.columns.deaths → 죽음
⟳ profile.matches.columns.knocked → 넉다운
Tokens: Input=2193, Output=3, Total=2196
[Example of extended thinking](https://preview.redd.it/xvzbrtt8mpne1.png?width=2034&format=png&auto=webp&s=879517ffeb75137450df78aa04849ce3ec6e1cb3)
https://preview.redd.it/qho3zfjhmpne1.png?width=2572&format=png&auto=webp&s=fcaeaeddfe76afd93622777ca83b00fd52282bc5
# Claude 3.7 Sonnet with Extended Thinking
We're now leveraging Claude 3.7's Extended Thinking capabilities. This means:
* Massive 200K token context window
* Up to 64K output tokens
* Better reasoning for complex translations
* More natural and contextually aware translations
# Surprise Feature: Crowdin Integration (Beta)
Here's something cool - you can now translate your Crowdin projects directly! And it's not just for Laravel - it works with ANY project on Crowdin. Want to know how? Drop a comment, and I'll share the details.
# Complete Code Overhaul
I basically rewrote the entire thing. The codebase is now:
* More maintainable with dedicated service classes
* Better organized with clear separation of concerns
* More efficient with optimized API calls
* More robust with improved error handling
# Want to Try It Out?
Check out the package: [kargnas/laravel-ai-translator](https://github.com/kargnas/laravel-ai-translator)
Let me know if you have any questions or run into issues. I'm actively maintaining this and would love your feedback!
P.S. If you're using the previous version, you might want to update - the consistency improvements alone are worth it.
P.S. Look at the default config file!
https://redd.it/1j7efct
@r_php
Weekly Ask Anything Thread
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1j7pbfw
@r_php
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1j7pbfw
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Samarium v0.9.4 - Improvements and fixes (PHP code update, DB seeding update, misc)
Hello all,
Made some improvements and fixes during February and March upto now to the ERP I have been developing with Laravel and Livewire. Wanted to share version 0.9.4 with you all. Also, thanks to couple of pull requests from the community.
https://github.com/oitcode/samarium
|Area|Improvements|
|:-|:-|
|PHP code updates|Updated PHP code to more recent standard with return type hinting in methods in Controller and Livewire components.|
|Test Code|Added some more test code. (Thanks to PR).|
|Database seeding|Added more seeder files. Now a minimum working website is setup as soon as you run seeder files at the beginning of installation.|
|Misc updates|Refactored many blade files to make them more easier to understand.|
Dashboard
https://preview.redd.it/j7b0byo11tne1.png?width=1850&format=png&auto=webp&s=9cca52e88ffb6c9005afc26cf1f997924a638870
Website homepage
https://preview.redd.it/ppi3kww41tne1.png?width=1848&format=png&auto=webp&s=d5fc9250be5b2dbb343f4c6aa06a14d5f76f2731
Just wanted to share this update here after working during February and March upto now.
Any feedback, comments and/or contributions are highly appreciated.
Thanks.
https://redd.it/1j7s9k1
@r_php
Hello all,
Made some improvements and fixes during February and March upto now to the ERP I have been developing with Laravel and Livewire. Wanted to share version 0.9.4 with you all. Also, thanks to couple of pull requests from the community.
https://github.com/oitcode/samarium
|Area|Improvements|
|:-|:-|
|PHP code updates|Updated PHP code to more recent standard with return type hinting in methods in Controller and Livewire components.|
|Test Code|Added some more test code. (Thanks to PR).|
|Database seeding|Added more seeder files. Now a minimum working website is setup as soon as you run seeder files at the beginning of installation.|
|Misc updates|Refactored many blade files to make them more easier to understand.|
Dashboard
https://preview.redd.it/j7b0byo11tne1.png?width=1850&format=png&auto=webp&s=9cca52e88ffb6c9005afc26cf1f997924a638870
Website homepage
https://preview.redd.it/ppi3kww41tne1.png?width=1848&format=png&auto=webp&s=d5fc9250be5b2dbb343f4c6aa06a14d5f76f2731
Just wanted to share this update here after working during February and March upto now.
Any feedback, comments and/or contributions are highly appreciated.
Thanks.
https://redd.it/1j7s9k1
@r_php
GitHub
GitHub - shyamsitaula/samarium: Open-source business management system with ERP, POS, invoicing, and CMS features. Laravel-based…
Open-source business management system with ERP, POS, invoicing, and CMS features. Laravel-based, Docker-ready. Still in active development. - shyamsitaula/samarium
Weekly help thread
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1j7stwo
@r_php
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1j7stwo
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Laravel updated its home page again, for the better.
Kudos to the team for listening to the community's feedback regarding the latest design changes. 👍
Posting this because I was among those who criticized the "scroll jacking" and bezels on the code blocks.
https://preview.redd.it/rrdwk9qvmtne1.jpg?width=1080&format=pjpg&auto=webp&s=af5a895f40f48f700e707f628f3db74be3ceae03
https://redd.it/1j7tsy2
@r_php
Kudos to the team for listening to the community's feedback regarding the latest design changes. 👍
Posting this because I was among those who criticized the "scroll jacking" and bezels on the code blocks.
https://preview.redd.it/rrdwk9qvmtne1.jpg?width=1080&format=pjpg&auto=webp&s=af5a895f40f48f700e707f628f3db74be3ceae03
https://redd.it/1j7tsy2
@r_php