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.
Let's discuss API Design with Symfony: Share your thoughts :)
Hello r/symfony
I have been thinking a lot about how you manage API development in Symfony, especially outside of API Platform (or with it, if you use it)
I would love to hear your feedback on the following topics:
# 1. How you manage API
* How do you handle your API if you don't use API Platform?
* What prevents you from using API Platform? (legacy code, difficulty getting started, other reasons?)
* How do you define your API ?
# 2. Data Modeling Approach
* Do you use the Entity/Document directly, or do you prefer a DTO approach? (e.g., `ArticlePayload` as input -> `ArticleEntity`)
* What do you return in your API ? A direct entity or a response DTO like `ArticleResponse` (with or wihtout using serialization groups) ?
* Do you use mappers to convert DTO to entities and vice versa (e.g., `ArticlePayload` \-> `ArticleEntity`, `ArticleEntity` \-> `ArticleResponse`)? If so, how do you implement them? (Automapper bundle, manually ?)
# 3. API Structure and Relationships
* How do you handle relationships when creating resources (one-to-one, one-to-many, many-to-many)?
* Do you allow nested resource creation? For example, can you create an article along with its category in a single `POST /api/articles` request?
* Or do you prefer separate requests, first creating the category and then linking it to the article ?
* Do you structure your controllers by resource (e.g., `ArticleResourceController`) or prefer action-based controllers (e.g., `GetOneArticleResourceController`)? Or do you use another approach?
# 4. API Platform
* What do you think about API Platform approach, where resources are defined with #\[ApiResource\] as single entry, and as default Input/Output and custom Input/Output can be specified for special cases if neccesary ?
* Do know or use `StateOptions` in API Platform to separate entity from resource ?
# 5. Format and Pagination
* What API format do you use? JSON:API, JSON-LD, simple JSON with a custom structure?
* How do you handle pagination and resource filtering? (Using DTO or query params in array format directly in the repository ?)
# 6. Versioning and Permissions
* How do you manage API versioning? (Header, URL \`/v1, other ?)
* How do you handle field visibility based on permissions/roles if you have need to do that ?
# 7. Documentation
* How do you document your API? NelmioApiDocBundle ? Other bundle/tools ?
# 8. Data Validation
* How do you handle data validation on input?
* Do you use normalizers/serializers to transform incoming and outgoing data for better performance (or automapper like jolicode) ?
I really love to get feedback from the community on these topics, especially to understand the different choices and constraints that lead to using or not using API Platform, or use one approach or any others and have the pro/cons of each one.
Thanks in advance for your insights !
Here a current approach that I use (for side project for the moment)
[https://www.sharecode.in/jOaWFI](https://www.sharecode.in/jOaWFI)
Let me know what do you think about this approach. Would you improve or change something? Is there anything you wouldn't use in this structure ? What is the pros/cons ?
Sorry for the long text, but defining and API architecture for our different use cases is quite challenging 😃
Thanks for your time spent replying and exchanging on this !
https://redd.it/1jp23sq
@r_php
Hello r/symfony
I have been thinking a lot about how you manage API development in Symfony, especially outside of API Platform (or with it, if you use it)
I would love to hear your feedback on the following topics:
# 1. How you manage API
* How do you handle your API if you don't use API Platform?
* What prevents you from using API Platform? (legacy code, difficulty getting started, other reasons?)
* How do you define your API ?
# 2. Data Modeling Approach
* Do you use the Entity/Document directly, or do you prefer a DTO approach? (e.g., `ArticlePayload` as input -> `ArticleEntity`)
* What do you return in your API ? A direct entity or a response DTO like `ArticleResponse` (with or wihtout using serialization groups) ?
* Do you use mappers to convert DTO to entities and vice versa (e.g., `ArticlePayload` \-> `ArticleEntity`, `ArticleEntity` \-> `ArticleResponse`)? If so, how do you implement them? (Automapper bundle, manually ?)
# 3. API Structure and Relationships
* How do you handle relationships when creating resources (one-to-one, one-to-many, many-to-many)?
* Do you allow nested resource creation? For example, can you create an article along with its category in a single `POST /api/articles` request?
* Or do you prefer separate requests, first creating the category and then linking it to the article ?
* Do you structure your controllers by resource (e.g., `ArticleResourceController`) or prefer action-based controllers (e.g., `GetOneArticleResourceController`)? Or do you use another approach?
# 4. API Platform
* What do you think about API Platform approach, where resources are defined with #\[ApiResource\] as single entry, and as default Input/Output and custom Input/Output can be specified for special cases if neccesary ?
* Do know or use `StateOptions` in API Platform to separate entity from resource ?
# 5. Format and Pagination
* What API format do you use? JSON:API, JSON-LD, simple JSON with a custom structure?
* How do you handle pagination and resource filtering? (Using DTO or query params in array format directly in the repository ?)
# 6. Versioning and Permissions
* How do you manage API versioning? (Header, URL \`/v1, other ?)
* How do you handle field visibility based on permissions/roles if you have need to do that ?
# 7. Documentation
* How do you document your API? NelmioApiDocBundle ? Other bundle/tools ?
# 8. Data Validation
* How do you handle data validation on input?
* Do you use normalizers/serializers to transform incoming and outgoing data for better performance (or automapper like jolicode) ?
I really love to get feedback from the community on these topics, especially to understand the different choices and constraints that lead to using or not using API Platform, or use one approach or any others and have the pro/cons of each one.
Thanks in advance for your insights !
Here a current approach that I use (for side project for the moment)
[https://www.sharecode.in/jOaWFI](https://www.sharecode.in/jOaWFI)
Let me know what do you think about this approach. Would you improve or change something? Is there anything you wouldn't use in this structure ? What is the pros/cons ?
Sorry for the long text, but defining and API architecture for our different use cases is quite challenging 😃
Thanks for your time spent replying and exchanging on this !
https://redd.it/1jp23sq
@r_php
Sharecode
ShareCode - AI-based Real Time Code Sharing Plateform
Realtime Code sharing plateform for developers.
Symfony validator codes
I was looking at the validator and saw that when you get a constraint violation, it is associated with a "code" in the format of a UUID. When I look at the constraint classes, I can see these hard coded UUIDs. I cannot find anything in the Symfony documentation referencing these, so my question is, what do these UUIDs reference?
For example, from Symfony\Component\Validator\Constraints\Length:
public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45';
public const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9';
public const NOT_EQUAL_LENGTH_ERROR = '4b6f5c76-22b4-409d-af16-fbe823ba9332';
public const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767';
In the constraint violation interface, the "code" field is described as "a machine-digestible error code for the violation". How would these codes be used?
https://redd.it/1jp2d8u
@r_php
I was looking at the validator and saw that when you get a constraint violation, it is associated with a "code" in the format of a UUID. When I look at the constraint classes, I can see these hard coded UUIDs. I cannot find anything in the Symfony documentation referencing these, so my question is, what do these UUIDs reference?
For example, from Symfony\Component\Validator\Constraints\Length:
public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45';
public const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9';
public const NOT_EQUAL_LENGTH_ERROR = '4b6f5c76-22b4-409d-af16-fbe823ba9332';
public const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767';
In the constraint violation interface, the "code" field is described as "a machine-digestible error code for the violation". How would these codes be used?
https://redd.it/1jp2d8u
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
The PHP Foundation: Impact and Transparency Report 2024
https://thephp.foundation/blog/2025/03/31/transparency-and-impact-report-2024/
https://redd.it/1jp6itg
@r_php
https://thephp.foundation/blog/2025/03/31/transparency-and-impact-report-2024/
https://redd.it/1jp6itg
@r_php
thephp.foundation
The PHP Foundation: Impact and Transparency Report 2024
The PHP Foundation — Supporting, Advancing, and Developing the PHP Language
This is an interactive video of the TALL stack web app i've created for small businesses
https://app.arcade.software/share/h1IWCpnFk0tsYB0N8bIz
I created this interactive video for the app i've created for managing small businnesses. i hope you all like it.
https://redd.it/1jp6lc6
@r_php
https://app.arcade.software/share/h1IWCpnFk0tsYB0N8bIz
I created this interactive video for the app i've created for managing small businnesses. i hope you all like it.
https://redd.it/1jp6lc6
@r_php
Arcade
Discover Our Dynamic Dashboard Experience
This is an interactive overview of Witty workflow and what it has to offer
Let’s Talk API Design – Share Your Thoughts
Hey everyone,
I recently wrote an article about API design, and I wanted to hear your thoughts on the topic. While I'm using Symfony as my framework, the discussion is more about API design principles. Whether you use Symfony, Laravel or any other PHP framework, I think we all face similar challenges when building API.
I’d love to hear your experiences and how you approach these challenges in your own projects !
Check out the original thread Let's discuss API Design with Symfony: Share your thoughts :)
https://redd.it/1jp6zrj
@r_php
Hey everyone,
I recently wrote an article about API design, and I wanted to hear your thoughts on the topic. While I'm using Symfony as my framework, the discussion is more about API design principles. Whether you use Symfony, Laravel or any other PHP framework, I think we all face similar challenges when building API.
I’d love to hear your experiences and how you approach these challenges in your own projects !
Check out the original thread Let's discuss API Design with Symfony: Share your thoughts :)
https://redd.it/1jp6zrj
@r_php
Reddit
From the symfony community on Reddit: Let's discuss API Design with Symfony: Share your thoughts :)
Explore this post and more from the symfony community
Rebuilding my 15-year-old PHP project with Symfony — looking for people who might want to help!
Hey everyone 👋
About 15 years ago, I built a complete RPG text-based engine in raw PHP — no framework, just pure old-school code. It took me around 3 years to get it to a stable and feature-rich state, and it was fully customizable so people could host their own games.
I’ve recently decided to bring the project back to life, this time using Symfony to make it clean, modular, and future-proof.
I’ve been coding on it in my free time, but honestly… I’m moving way too slowly. Between work, life, and learning the Symfony way of doing things properly, I feel like at this rate, it’ll take me another 10 years to get anywhere 😅
My plan:
Rewrite the whole engine with a clean MVC architecture
Make it easy to install, host, and extend
Use SQLite first (PostgreSQL later possible)
Turn it into a real open-source project that others can use, fork, or build their own games on
I’m still working actively on the codebase, but I’d love to find others who might be interested in this kind of project and want to contribute — whether with ideas, code, testing, or just hanging around to share feedback.
Here’s the GitHub repo if you're curious:
https://github.com/brindiwanko/Caranille
Thanks for reading! If this sounds like your kind of side project, feel free to drop a comment or join the repo. Let’s make it awesome together 🚀
Cheers,
Jérémy
https://redd.it/1jpjshl
@r_php
Hey everyone 👋
About 15 years ago, I built a complete RPG text-based engine in raw PHP — no framework, just pure old-school code. It took me around 3 years to get it to a stable and feature-rich state, and it was fully customizable so people could host their own games.
I’ve recently decided to bring the project back to life, this time using Symfony to make it clean, modular, and future-proof.
I’ve been coding on it in my free time, but honestly… I’m moving way too slowly. Between work, life, and learning the Symfony way of doing things properly, I feel like at this rate, it’ll take me another 10 years to get anywhere 😅
My plan:
Rewrite the whole engine with a clean MVC architecture
Make it easy to install, host, and extend
Use SQLite first (PostgreSQL later possible)
Turn it into a real open-source project that others can use, fork, or build their own games on
I’m still working actively on the codebase, but I’d love to find others who might be interested in this kind of project and want to contribute — whether with ideas, code, testing, or just hanging around to share feedback.
Here’s the GitHub repo if you're curious:
https://github.com/brindiwanko/Caranille
Thanks for reading! If this sounds like your kind of side project, feel free to drop a comment or join the repo. Let’s make it awesome together 🚀
Cheers,
Jérémy
https://redd.it/1jpjshl
@r_php
GitHub
GitHub - brindiwanko/Caranille: RPG Maker on PHP
RPG Maker on PHP. Contribute to brindiwanko/Caranille development by creating an account on GitHub.
Headless CMS vs. Custom-Built CMS with PHP: Which One Enhances Skills and Career Growth?
Should I use a headless CMS or build my own CMS with PHP? Which option helps improve my skills the most and benefits my future career?
https://redd.it/1jpk1jv
@r_php
Should I use a headless CMS or build my own CMS with PHP? Which option helps improve my skills the most and benefits my future career?
https://redd.it/1jpk1jv
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Powerful timeseries metrics using TimescaleDB and Laravel
https://youtu.be/YFujIFWrkZQ
https://redd.it/1jpmbb7
@r_php
https://youtu.be/YFujIFWrkZQ
https://redd.it/1jpmbb7
@r_php
YouTube
Powerful timeseries metrics using Timescale and Laravel
#laravel #development #postgres #timescale
In this video I talk about how we use Timescale and Postgres to power our analytics platform.
---
👉 Book a consulting call: https://cal.com/sabatino/developer-consulting
---
Demo repository: https://github.co…
In this video I talk about how we use Timescale and Postgres to power our analytics platform.
---
👉 Book a consulting call: https://cal.com/sabatino/developer-consulting
---
Demo repository: https://github.co…
Need Better Filtering, Searching & Sorting in Laravel? Check Out Query Builder Criteria! 🚀
https://github.com/omaressaouaf/query-builder-criteria
https://redd.it/1jpsh21
@r_php
https://github.com/omaressaouaf/query-builder-criteria
https://redd.it/1jpsh21
@r_php
GitHub
GitHub - omaressaouaf/query-builder-criteria: Define reusable query criteria for filtering, sorting, search, field selection, and…
Define reusable query criteria for filtering, sorting, search, field selection, and includes in Laravel Eloquent models - omaressaouaf/query-builder-criteria
Need Better Filtering, Searching & Sorting in Laravel? Check Out Query Builder Criteria! 🚀
https://github.com/omaressaouaf/query-builder-criteria
https://redd.it/1jpsn3x
@r_php
https://github.com/omaressaouaf/query-builder-criteria
https://redd.it/1jpsn3x
@r_php
GitHub
GitHub - omaressaouaf/query-builder-criteria: Define reusable query criteria for filtering, sorting, search, field selection, and…
Define reusable query criteria for filtering, sorting, search, field selection, and includes in Laravel Eloquent models - omaressaouaf/query-builder-criteria