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/1jntxdp
@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/1jntxdp
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Should I Master Pure PHP Before Becoming a Laravel Expert?
To become a master of Laravel, do I need to be really proficient in pure PHP first? I already have programming skills, understand OOP, and know PHP syntax along with common functions. I also built my graduation project using Laravel. However, I don't have a deep understanding of Laravel yet. I have never built a complete system with pure PHP, nor have I manually implemented models like MVC from scratch.
I want to gain deep understanding to optimize performance and enhance security as well. So, should I develop a complete system using pure PHP first?
https://redd.it/1jnu1yn
@r_php
To become a master of Laravel, do I need to be really proficient in pure PHP first? I already have programming skills, understand OOP, and know PHP syntax along with common functions. I also built my graduation project using Laravel. However, I don't have a deep understanding of Laravel yet. I have never built a complete system with pure PHP, nor have I manually implemented models like MVC from scratch.
I want to gain deep understanding to optimize performance and enhance security as well. So, should I develop a complete system using pure PHP first?
https://redd.it/1jnu1yn
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Counter strike like game with 100% PHP code test coverage
https://github.com/solcloud/Counter-Strike
https://redd.it/1jnzaxu
@r_php
https://github.com/solcloud/Counter-Strike
https://redd.it/1jnzaxu
@r_php
GitHub
GitHub - solcloud/Counter-Strike: Multiplayer FPS game - Counter-Strike: Football 🏉
Multiplayer FPS game - Counter-Strike: Football 🏉. Contribute to solcloud/Counter-Strike development by creating an account on GitHub.
Fixing error handling in Inertia.js
https://mnapoli.fr/fixing-inertia-error-handling
https://redd.it/1jnzpd2
@r_php
https://mnapoli.fr/fixing-inertia-error-handling
https://redd.it/1jnzpd2
@r_php
Hi!
Fixing error handling in Inertia.js
Bref Cloud is built with Laravel and Inertia.js. Inertia.js connects Laravel with Vue.js, making everything related to routing, auth, state management, and more, much easier to handle. Inertia.js is awesome. However, there is one thing that I really dislike…
Websockets and real-time events in NativePHP for mobile
https://www.youtube.com/watch?v=6jS_0FKW_Bo&ab_channel=SimonHamp
https://redd.it/1jo1g6s
@r_php
https://www.youtube.com/watch?v=6jS_0FKW_Bo&ab_channel=SimonHamp
https://redd.it/1jo1g6s
@r_php
YouTube
Websockets and real-time events in NativePHP for mobile
This is one of those critical pieces web applications that I think it's imperative we have on mobile apps built this way.
With NativePHP for mobile, it's a breeze! 🍃
Real-time support will be launching in the coming days.
💌 Join the newsletter
https:/…
With NativePHP for mobile, it's a breeze! 🍃
Real-time support will be launching in the coming days.
💌 Join the newsletter
https:/…
I broke down improvements of switching to ParaTest
https://tilbrooktech.com/articles/2025/03/faster-tests-with-paratest
https://redd.it/1jo1gml
@r_php
https://tilbrooktech.com/articles/2025/03/faster-tests-with-paratest
https://redd.it/1jo1gml
@r_php
Jarryd Tilbrook
Using ParaTest for running tests faster - Jarryd Tilbrook
How to switch to ParaTest so your test suite can take advantage of parallelism and execute faster.
How do you handle client requested data changes?
Lets say you deployed an app for a client.
Now the client comes back to you and requests some data to be changed, like wording in a table column. Or maybe changing the parent\\child of some data...
1. Create migration to change the data
2. Edit manually in SQL tooling
3. Create a custom endpoint that applies it in code
4. ...?
What's best practice here?
(To be clear, not database structure changes)
https://redd.it/1jo2wek
@r_php
Lets say you deployed an app for a client.
Now the client comes back to you and requests some data to be changed, like wording in a table column. Or maybe changing the parent\\child of some data...
1. Create migration to change the data
2. Edit manually in SQL tooling
3. Create a custom endpoint that applies it in code
4. ...?
What's best practice here?
(To be clear, not database structure changes)
https://redd.it/1jo2wek
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Fixing error handling with Inertia.js and Laravel
https://mnapoli.fr/fixing-inertia-error-handling
https://redd.it/1jo5i2q
@r_php
https://mnapoli.fr/fixing-inertia-error-handling
https://redd.it/1jo5i2q
@r_php
Hi!
Fixing error handling in Inertia.js
Bref Cloud is built with Laravel and Inertia.js. Inertia.js connects Laravel with Vue.js, making everything related to routing, auth, state management, and more, much easier to handle. Inertia.js is awesome. However, there is one thing that I really dislike…
20 Laravel Features I Never Knew About (Until I Read ALL the Docs!)
https://youtu.be/kefX13MaJiQ
https://redd.it/1job1dy
@r_php
https://youtu.be/kefX13MaJiQ
https://redd.it/1job1dy
@r_php
YouTube
20 Laravel Features I Never Knew About (Until I Read ALL the Docs!)
Even after years of working with Laravel, I thought I knew it all... until I didn't! I decided to read through the ENTIRE Laravel documentation, and wow - I'm honestly amazed at what I discovered.
In this video, I'm sharing 20 features that caught me completely…
In this video, I'm sharing 20 features that caught me completely…
Is route:cache enough for mostly-static websites?
I'm working on a small e-commerce website that sells 7 products in total. Which gets the products from the database. And the data doesn't change often (if at all).
So, what kind of caching method would you recommend for this? Do I use something like
https://redd.it/1joc2ju
@r_php
I'm working on a small e-commerce website that sells 7 products in total. Which gets the products from the database. And the data doesn't change often (if at all).
So, what kind of caching method would you recommend for this? Do I use something like
Cache::rememberforever and re-set the cache when model changes? Or would php artisan route:cache command be enough for this purpose?https://redd.it/1joc2ju
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Improving at Legacy Code
I don't know if this is the right place to ask this, but I've come to the conclusion that (entirely unintentionally) my career has made me specialise in Legacy code over the last few years.
However, I've been wondering what the best way is for me to get "better" at dealing with legacy code. I think it would be a nice skill to have on my CV if/when I move on to a new job, and likely something that will never be entirely useless. So far it's been mostly by accident but I wonder where I would go from here if I were more intentional about it.
(Apologies if this qualifies as "asking for help", I intend it mostly as a discussion and to hear from others in a similar position.)
https://redd.it/1jodq69
@r_php
I don't know if this is the right place to ask this, but I've come to the conclusion that (entirely unintentionally) my career has made me specialise in Legacy code over the last few years.
However, I've been wondering what the best way is for me to get "better" at dealing with legacy code. I think it would be a nice skill to have on my CV if/when I move on to a new job, and likely something that will never be entirely useless. So far it's been mostly by accident but I wonder where I would go from here if I were more intentional about it.
(Apologies if this qualifies as "asking for help", I intend it mostly as a discussion and to hear from others in a similar position.)
https://redd.it/1jodq69
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Vote: Facades, helpers, or pure DI?
\\"Pure\\" DI
Helper functions
Facade
What is your preferred way of doing it?
Please, elaborate.
https://redd.it/1jogk9u
@r_php
\\"Pure\\" DI
Helper functions
Facade
What is your preferred way of doing it?
Please, elaborate.
https://redd.it/1jogk9u
@r_php
PHP Crash Course by Matt Smith
I've been meaning to learn PHP for a while now, but life got in the way. I remember Jon Duckett, Program with Gio, and Laracasts as being much recommended sources to learn from. However, I also noticed a book that came out very recently: PHP Crash Course by Matt Smith. I like that it's recent and that it provides exercises with each chapter.
Does anyone here have experience with this book? Or does it seem like it focuses on the right subjects? There's a nice sample to look through at the link above.
https://redd.it/1jorxih
@r_php
I've been meaning to learn PHP for a while now, but life got in the way. I remember Jon Duckett, Program with Gio, and Laracasts as being much recommended sources to learn from. However, I also noticed a book that came out very recently: PHP Crash Course by Matt Smith. I like that it's recent and that it provides exercises with each chapter.
Does anyone here have experience with this book? Or does it seem like it focuses on the right subjects? There's a nice sample to look through at the link above.
https://redd.it/1jorxih
@r_php
NelmioApiDocBundle
Hi everyone, I’m using nelmio v5.0.1 with swagger v4.8.7 is there any way to create global parameters for route /api/ ? I have authentication by headers (Auth-Login and Auth-Password) and I don’t want to put it in every controller under /api/…
https://redd.it/1jot2le
@r_php
Hi everyone, I’m using nelmio v5.0.1 with swagger v4.8.7 is there any way to create global parameters for route /api/ ? I have authentication by headers (Auth-Login and Auth-Password) and I don’t want to put it in every controller under /api/…
https://redd.it/1jot2le
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Handling large array without going over memory limit
Greetings. I have a large file with formatted multidimensional json i need to process. Currently I am using file_get_contents(), which sometimes ends in error "Allowed memory size exhausted".
I tried using fopen()/fgets(), but working with it seems a bit tricky:
1. It's a multidimensional array and fgets() returns a string that can't be parsed via json_decode(), like so:
2. Do I need to check every line for closing
Sorry if it's a stupid question, not really that familiar with PHP.
https://redd.it/1jovotx
@r_php
Greetings. I have a large file with formatted multidimensional json i need to process. Currently I am using file_get_contents(), which sometimes ends in error "Allowed memory size exhausted".
I tried using fopen()/fgets(), but working with it seems a bit tricky:
1. It's a multidimensional array and fgets() returns a string that can't be parsed via json_decode(), like so:
' "Lorem": "Ipsum",'. Am I supposed to trim trailing commas and spaces and add brackets myself?2. Do I need to check every line for closing
}] to parse nested array myself?Sorry if it's a stupid question, not really that familiar with PHP.
https://redd.it/1jovotx
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
AI Agents Memory And Context Window In PHP
https://inspector.dev/ai-agents-memory-and-context-window-in-php/
https://redd.it/1jou93h
@r_php
https://inspector.dev/ai-agents-memory-and-context-window-in-php/
https://redd.it/1jou93h
@r_php
Inspector
AI Agents Memory And Context Window In PHP
AI Agents in PHP with memory management and context window handling. Enable persistent, intelligent conversations.