PHP Reddit – Telegram
PHP Reddit
34 subscribers
292 photos
37 videos
24.9K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
PHP and Service layer pattern

Hello, I have a small SaaS as a side product, for a long time I used to be a typical MVC guy. The views layer sends some requests to the controller's layer, the controller handles the business logic, then sends some commands to the model layer, and so on. By the time the app went complicated - while in my full-time job we used to use some "cool & trendy" stuff like services & repository pattern- I wanted to keep things organized. Most of the readings around the internet is about yelling at us to keep the business logic away of the controllers, and to use something like the service layer pattern to keep things organized. However, I found myself to move the complexity from the controller layer to the service layer, something like let's keep our home entrance clean and move all the stuff to the garage which makes the garage unorganized. My question is, how do you folks manage the service layer, how to keep things organized. I ended up by enforcing my services to follow the "Builder Pattern" to keep things mimic & organized, but not sure if this is the best way to do tho or not. Does the Builder Pattern is something to rely on with the services layer? In the terms of maintainability, testability ... etc.

Another direction, by keeping things scalar as much as possible and pass rely on the arguments, so to insert a blog post to the posts table & add blog image to the images table, I would use posts service to insert the blog post and then get the post ID to use it as an argument for the blog images service.

https://redd.it/1jyurvf
@r_php
Should a Backend Engineer Learn AI or Focus Solely on Backend Skills? How to Become a Senior Backend Engineer?

Should a backend engineer consider learning more about AI, or is it better to concentrate on strengthening backend-specific skills? What are the best ways to become a senior backend engineer?

https://redd.it/1jyvg95
@r_php
Xdebug hangs on breakpoint after upgrading to PHP 8.3

https://preview.redd.it/w39y5sfprsue1.png?width=2048&format=png&auto=webp&s=63c94720f4b58659529206cfaf3a0879c1a893d0

Not sure if this is the right sub for this, but here it goes.

I'm currently upgrading from PHP 7.4 to PHP 8.3, and I'm running into a really strange issue when using Postman to make requests to my API while debugging with Xdebug.

https://preview.redd.it/xidh3g60tsue1.png?width=822&format=png&auto=webp&s=1c9bce5279cd45936a86b3848400ab2ffe483b19

If I don’t set any breakpoints in the code, everything works fine and I get the expected response. But if I set any breakpoint (literally anywhere), the request just hangs and eventually fails with an error in Postman.

On the PHPStorm side, everything seems to be properly configured — PHP version, Xdebug port, path mappings, etc.

I’ve tested a ton of things already, and I’m quite certain the issue is with Xdebug itself — but I can’t figure out if it’s a misconfiguration in PHPStorm or if I’m just doing something wrong.

I'm using:
PHP 8.3.8
Xdebug 3.3.2
Symfony 5.9.1

Any ideas or pointers would be greatly appreciated!

https://redd.it/1jyyeq3
@r_php
Need Better Filtering, Searching & Sorting for DataTables in Laravel? Check Out Query Builder Criteria! 🚀

https://preview.redd.it/f3yxxnr8ntue1.png?width=1712&format=png&auto=webp&s=246f8771f46dac46f6932422c04208016cc30c44



Hey everyone! I just released a Laravel package called Query Builder Criteria, designed to make filtering, sorting, and paginating large datasets much easier—especially for datatables, admin panels, and management apps.

🔹 Automatically applies filters & sorting from the request query string
🔹 Encapsulates query logic into reusable, maintainable criteria
🔹 Keeps controllers & repositories clean
🔹 Works seamlessly with pagination for large datasets

If you’re tired of cluttered query logic and want a clean, scalable approach to handling dynamic queries, check it out on GitHub:

🔗 **github.com/omaressaouaf/query-builder-criteria**

Would love to hear your thoughts—feedback & contributions are welcome! 🚀

https://redd.it/1jz26i2
@r_php
PHP Error Types Explained - Warnings, Notices, Fatal Errors, etc.

The article explains the different types of errors encountered in PHP programming and their significance: Common PHP Error Types Explained - Warnings, Notices & Fatal Errors

It categorizes PHP errors based on their severity and impact on noscript execution, providing examples and solutions for each type. The main error types discussed include fatal errors, parse errors, warnings, noticse, deprecated errors.

The article also includes debugging strategies and emphasizes the importance of understanding these error levels to ensure effective troubleshooting and maintain best practices in PHP development. It also includes debugging strategies and emphasizes the importance of understanding these error levels to ensure effective troubleshooting.

https://redd.it/1jzip2p
@r_php
Form data validation with regular expression

My form builder site allows users to specify a regular expression for html 5 input pattern validation.

In addition to validating this on the client side with html5, the service also validates on the server side after submission as client side validation can be circumvented (e.g. by removing the pattern attribute in browser dev tools).

Client side regex on pattern attribute is compiled with the "v" flag which "enhances Unicode support in regular expressions, enabling the use of set notation, string literals within character classes, and properties of strings".

On the server side my noscript checks the input matches the pattern but the "v" flag is not available in php regex functions (I'm on php 8.3) so I am using the "u" flag.

Is this likely to fail in any circumstance? Is there a way to ensure the results are the same in JS and PHP?

Thanks guys.

https://redd.it/1jzlavw
@r_php
Simple php based anayltics

I have just created a very simple self hosted anayltics noscript: https://github.com/elzahaby/php-analytics/tree/main

would love to hear your opinon. The goal was to create a simple but useful anayltics noscript that allows me to ditch google analytics and since it is based on server data it doesn't require any cookies consent as far as I know.

Looking forward to hear your thoughts and what features you wish for or how to improve it :)

https://redd.it/1jzpu5a
@r_php
How do I create an emoji font file, specific to a website and app?

I'm a total NOOB when it comes to stuff about emojis, from the system side.

Okay, what I'm about to ask is wild, and I know its a strong chance I won't getting any full on tutorials for this. I just need some leads at least into the right direction.

Long story short, I'm working with a team to build a website/app for various online use for our target audience. The emoji system is painfully limited, and are based on the Microsoft Segoe UI for Windows. Platforms often have their own emoji, Facebook, Discord, Youtube, while like Reddit DO use the Segoe UI it seems. What would I need to do, in order to create emojis for my team's website/app?

ASSUMPTIONS
This is what I assume it would require, and I'd like some insight before I proceed to waste my time with these guesses.

Custom font: the site would need it's own font, that is unique to the site, in order to display emoji.

OTF font type: to house a lot of emoji glyphs, and of course, SVG vectors as emoji.

SVG: all emoji art I'd assume would have to be SVGs, in order to be scalable and work with the font face.

Some kinda "encoding": for lack of better phrasing, once the file is created, you'll need to like... perform some kind of formatting or "encoding" so the font file is properly compatible for web and mobile use.

PHP: I'm learning some bare bones in navigating PHP (this project calls for it), and I believe there's some some sort of .php file and line(s) of code to implement your font, and some more PHP knowhow to implement your emoji.

ANY HELP is majorly appreciated, any leads, just anything.

https://redd.it/1k09hln
@r_php
Resources to learn pure php best practices?

I recently have become involved in maintaining a legacy php application running php 7. Does anyone have any recommendations for learning the fundamentals of php?

I come from a web dev background mostly using rails. The application I'm working with generally makes sense to me, and I am able to get things working. However I'd love to have some idea what I'm doing beyond simply making things work.

We're attempting to build out some new features with moderately complex logics. More intricate DB interactions, users submitting/displaying html, including a few JS libraries, and some other stuff. Im very interested in getting a better understanding of php in order to properly design these features.

https://redd.it/1k0eui7
@r_php
What do you like least about Laravel?

Laravel is a great framework, and most of us love working with it. It’s simple, powerful, and gets you pretty far without much sweat.

But what’s the thing you like least about it as a dev?

Could it be simpler? Should it be simpler?

Has convention over configuration gone too far—or not far enough?

Any boilerplate that still bugs you?

https://redd.it/1k0fn4t
@r_php
Looking to Join an Interesting Project

Hey everyone!

I’ve been feeling really motivated lately to collaborate on something meaningful or just plain fun. I’m not here to pitch my own idea – I actually want to join someone else’s project and contribute however I can.

Whether you're working on a startup, a coding project, an open-source tool, a game, or even a creative non-tech endeavor – if you’re passionate about it, I’d love to hear about it. I'm eager to jump in and help with development, design, testing, brainstorming, or just being that extra pair of hands to keep things moving.

Let me know if you have something I can help you!

https://redd.it/1k0o4vs
@r_php
Just hit 300,000 installs on my little PHP package 🎉

It’s one of those moments where you realize—open source is magic.


You put something out there, and it grows beyond you.
It lives because people use it, improve it, and share it.

If you've ever used it, contributed, or even just told someone about it—
thank you. Seriously.

Here is the story: https://medium.com/@revaz.gh/php-heic-to-jpgthe-easiest-way-to-convert-heic-heif-images-to-jpeg-using-php-745d66818dfd

https://redd.it/1k0qkk5
@r_php
Launching TrueReviewer — A Robust & Complete Review and Rating System for Laravel

After successfully launching Commenter, I began my next big mission — TrueReviewer. I might be biased, but I believe TrueReviewer is one of the most complete and powerful review systems available for Laravel. Whether you're building a SaaS platform, e-commerce site, or any other web app, it’s designed to fit right in.

Unlike Commenter, TrueReviewer is API-agnostic — meaning the front-end (Vue.js) and back-end are completely decoupled. This gives you the freedom to integrate it into any Laravel project, whether it's a traditional server-side rendered app or a fully separated API-driven architecture using Vue as the front end. Since the Vue components are compiled into JavaScript, it works seamlessly across tech stacks.

TrueReviewer focuses on performance, customization, and design. It comes with five beautifully crafted components that are not just visually appealing but also accessible and user-friendly. Each component is built to make an impact without overwhelming the UI, offering a smooth and intuitive experience. Thanks to its modular design, you can use components independently based on your project’s needs.

Going beyond traditional review systems, TrueReviewer includes AI-powered features like sentiment detection and integrity checks, helping ensure the quality and trustworthiness of reviews.

TrueReviewer is currently offered as sponsorware — a paid product. I understand that the Laravel community often prefers open-source tools, and I genuinely planned to release this as open-source. However, given the effort, time, and resources involved, I needed to find a balance between sustainability and community contribution.

I hope you’ll see the value in this package — and if it helps your project, that alone makes it worth it.

Official Site - https://truereviewer.netlify.app

Product Hunt - https://www.producthunt.com/posts/truereviewer

https://preview.redd.it/1juvpp1lgbve1.jpg?width=1156&format=pjpg&auto=webp&s=b7fd144cf703189f4ea7d4160c856d3206129d5f

https://preview.redd.it/lhzguxgogbve1.jpg?width=1249&format=pjpg&auto=webp&s=0658633ad86e567cf8bc93a973737763e71ce01e

https://preview.redd.it/7bofkp5pgbve1.jpg?width=1247&format=pjpg&auto=webp&s=039cf103d8eb27e3e08db680320f0e12f01f5fe7

https://preview.redd.it/e8tcr7upgbve1.jpg?width=1249&format=pjpg&auto=webp&s=8963e439921a2fa07c1b0055ccf18ee6eeb033ef

https://preview.redd.it/tjvrrpuqgbve1.jpg?width=1272&format=pjpg&auto=webp&s=1e5149cba5097c163e84313c8955ff6d7a2f5089

https://preview.redd.it/7c6p9xuqgbve1.jpg?width=1259&format=pjpg&auto=webp&s=254320b4659e981a7d556c7a097b1510c861f8d0

https://preview.redd.it/1q6l4vwrgbve1.jpg?width=1317&format=pjpg&auto=webp&s=1d7d8d73a574b1a42469db6fc102f9ad4018cafd

https://redd.it/1k13id4
@r_php
Launching TrueReviewer — A Robust & Complete Review and Rating System for Laravel

After successfully launching Commenter, I began my next big mission — TrueReviewer. I might be biased, but I believe TrueReviewer is one of the most complete and powerful review systems available for Laravel. Whether you're building a SaaS platform, e-commerce site, or any other web app, it’s designed to fit right in.

Unlike Commenter, TrueReviewer is API-agnostic — meaning the front-end (Vue.js) and back-end are completely decoupled. This gives you the freedom to integrate it into any Laravel project, whether it's a traditional server-side rendered app or a fully separated API-driven architecture using Vue as the front end. Since the Vue components are compiled into JavaScript, it works seamlessly across tech stacks.

TrueReviewer focuses on performance, customization, and design. It comes with five beautifully crafted components that are not just visually appealing but also accessible and user-friendly. Each component is built to make an impact without overwhelming the UI, offering a smooth and intuitive experience. Thanks to its modular design, you can use components independently based on your project’s needs.

Going beyond traditional review systems, TrueReviewer includes AI-powered features like sentiment detection and integrity checks, helping ensure the quality and trustworthiness of reviews.

TrueReviewer is currently offered as sponsorware — a paid product. I understand that the Laravel community often prefers open-source tools, and I genuinely planned to release this as open-source. However, given the effort, time, and resources involved, I needed to find a balance between sustainability and community contribution.

I hope you’ll see the value in this package — and if it helps your project, that alone makes it worth it.

Product Hunt

https://preview.redd.it/0k8sm3oc2cve1.jpg?width=1156&format=pjpg&auto=webp&s=d6c92a08acb17b7bc2bef9922d0a2fd91c97d1e3

https://preview.redd.it/64cxfoaj2cve1.jpg?width=1249&format=pjpg&auto=webp&s=3039f4bc293dfea5b3b44be08799f46201ca505f

https://preview.redd.it/6ftzjchv2cve1.jpg?width=1259&format=pjpg&auto=webp&s=9bd82b3d3f37fd8c86c485ba75c1d8710e9f9b70

https://preview.redd.it/qnfb56cw2cve1.jpg?width=1317&format=pjpg&auto=webp&s=9bd6c2a7d110af5cb47ef22886ae4fda7f980946



https://redd.it/1k15hxp
@r_php