PHP Reddit – Telegram
PHP Reddit
34 subscribers
291 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
TrueReviewer – A Robust and Customizable Product Review Package for Laravel

Hello coders,

I'm LakM, the creator of the [commenter](https://github.com/Lakshan-Madushanka/laravel-comments) package. I noticed that a modern product review package is something the Laravel community currently lacks. While building your own solution might work for a couple of projects, in the long term, we need something reusable and maintainable to save development time. That’s why I created **TrueReviewer**.

TrueReviewer is a robust review and rating system tailored for Laravel applications, featuring five thoughtfully designed components that enhance user experience. With a **modern**, **responsive design** and **customizable options**, TrueReviewer allows you to integrate reviews seamlessly into your application. The system is API-agnostic, ensuring compatibility with various platforms. TrueReviewer not only helps build trust and credibility through positive reviews but also boosts customer engagement and improves online visibility. With advanced features like dynamic sub-ratings, interactive statistics, and a comprehensive review list, TrueReviewer is the ultimate solution for managing user feedback.

TrueReviewer is **API agnostic** which means 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.

**Key Features**

* 📲 Modern, responsive design.
* ⚙️ Highly customizable to suit your preferences.
* 🎨 Theming with free presets and customizable colors.
* 🌐 API-agnostic for seamless integration.
* 🚀 High performance powered by Vue.js and Laravel.
* 🌍 Designed to cater to diverse user needs
* 🎯 Packed with all the essential features
* 🧾 Widget to summarize product reviews effectively
* 📊 Interactive statistics for deeper insights
* 🧩 Dynamic sub-ratings for detailed product evaluation
* 🖼️ Advanced media gallery for an immersive visual experience
* 📜 Comprehensive review list with pagination
* 🧭 Robust filtering options for quick navigation
* 📝 Elegant, user-friendly forms with built-in validation
* 🔐 Enhanced security features for peace of mind
* 🤝 Product recommendation capabilities
* 👍 React to reviews with helpfulness ratings
* 🚩 Ability to report inappropriate reviews
* 🚀 And much more to elevate the review experience!

Currently package is a sponsorware (big thank to calebporzio for the idea) and will be open-source with your support. **Huge discounts are available for first 10 users**.

Any feedback is greatly appreciated!

Demo Video - [https://youtu.be/-NJszz8lnuA](https://youtu.be/-NJszz8lnuA)

Site - truereviewer.netlify.app

https://preview.redd.it/cc5rjw8oz41f1.jpg?width=1280&format=pjpg&auto=webp&s=8a780504788c5cb6021ccd7837b7e233caa9eb41




https://redd.it/1knzlaa
@r_php
Recommend good free headless CMS for PHP e-commerce

Hi, before anyone says that this has been talked over a million times let me defend myself by saying that the results I found so far were very old or related to Next.JS

Please share stories what you use and why. I create frontends myself, but hate Wordpress, so I’m looking for fully headless CMS I could use for building great e-commerce websites. Tried storyblok in the past but it was meh and many workarounds needed to be done to fit for ecommerce use case, because it feels like Storyblok should be used only for blogs or simple webpages that only contain information.

https://redd.it/1ko090a
@r_php
Seperate marking site or all on app?

Hi just wanted to get some feedback, we are building a listing web app in laravel, Inertia and React.

We are wondering if we could build the marketing parts in framer or webflow and have the app on a sub domain.

We're just worried that we will be fighting seo etc with the subdomain if we go this route.

As its a listing site we want the individual profile pages to not be affected by the marketing site.

What would you guys do? There pros and cons for each route, just wanted some feedback, thanks

https://redd.it/1ko5tb8
@r_php
DTO: Pros and Cons of various DTO packages

I want to use DTOs and I am not sure which of the following packages I should use:

* [spatie/laravel-data](https://github.com/spatie/laravel-data)
* [cuyz/valinor](https://github.com/cuyz/valinor)
* [romanzipp/Laravel-DTO](https://github.com/romanzipp/Laravel-DTO)
* [WendellAdriel/laravel-validated-dto](https://github.com/WendellAdriel/laravel-validated-dto)
* [cerbero90/laravel-dto](https://github.com/cerbero90/laravel-dto)
* [YorCreative/Laravel-Argonaut-DTO](https://github.com/YorCreative/Laravel-Argonaut-DTO)
* Any other package anyone knows about

They all seem to have different functionality and I am finding it difficult to make my own comparison.

https://redd.it/1kos1nt
@r_php
Shorten if conditions (or chain)

What is your choice and reason ? I think second one is more concise and performant.

Share if you know a way to shorten and(&&) chain.

if ($role === 'admin' || $role === 'writer' || $role === 'editor') {

// logic here
}

if (in_array($role, ['admin', 'writer', 'editor'])) {

// logic here
}



https://redd.it/1kotdn9
@r_php
Looking for Advanced PHP Video Tutorial (OOP, Design Patterns, Real-World Project)

Hey folks,

(tl;dr in the last paragraph)

I'm in a bit of a weird spot and hoping some of you might have suggestions.

I currently work at a web agency where we deal mostly with CMS setups, PIM systems, and similar tools. My formal education was fairly limited, but enough to get me comfortable with procedural PHP, designing relational databases, and building small to medium-sized web apps. Not groundbreaking, but enough to land a junior dev job.

That said, I recently had a realization: it’s been almost a year since I finished my education, and I haven’t done much actual programming since then. My job mostly revolves around configuring systems, tweaking templates, and adding minor features to existing backends—rarely building anything from scratch. I’ve done a few small personal projects (hosted myself), but nothing that pushed me beyond vanilla procedural PHP and basic MariaDB usage.

Back in my education, I did learn the fundamentals of OOP, but it was limited—about 20 hours of instruction and a practical exam. Since then, I haven’t really used it.

To stay confident in calling myself a "developer", and to retain and improve my overall employability, I want to deepen and broaden my skill set outside of work. Ideally, this should still benefit me in my current role, which is why I’m leaning toward PHP rather than jumping straight into another language. My goal is to really dive into object-oriented programming, SOLID principles, design patterns, and architecture - all the foundational, transferable concepts that make for future-proof development skills that should also act as foundation for further improving in other concepts/technologies.
Python was a strong contender (and still is, for other reasons, resources being one of them), but since PHP is what I work with every day, I’d prefer to apply those concepts directly without having to mentally “translate” everything back into my main language.

So here’s what I’m looking for:

An advanced PHP tutorial, ideally in video format
Up-to-date (ideally modern PHP syntax with type hints, etc.)
Covers OOP, SOLID, design patterns, and related concepts in depth
Focuses on building a larger, realistic project, not isolated “Dog extends Animal” style examples
Aimed at devs who already understand CRUD, DB design, and procedural programming, but want to level up
Preferably engaging and paced for self-study during free time

I’ve looked around (YouTube, Udemy, etc.), but most content either starts too basic, touches on advanced concepts only briefly, or feels outdated. If anyone knows a good course, YouTube playlist that fits this denoscription, I’d be super grateful.
I'm also willing to go for paid resources if it's worth the money.

Thanks in advance!



tl;dr:
So, I’m looking for an up-to-date, advanced PHP video tutorial—preferably one that focuses on OOP, SOLID principles, design patterns, and real-world architecture. I’d love something that involves building a larger project step-by-step, rather than basic isolated examples. It should be for people who are already comfortable with CRUD apps, procedural code, and relational DBs, and who want to level up into more robust, transferable skills that could apply across languages. Video format is strongly preferred, as I find it more engaging for self-study in my free time. If anyone knows a resource like that, I’d hugely appreciate the recommendation.

https://redd.it/1koy266
@r_php
[Update] Laravel AI Translator: Gemini Support + Parallel Translations!
https://kargn.as/projects/laravel-ai-translator

https://redd.it/1koymxw
@r_php
Authenticatable: shouldn't the interfaces be thinner?

Recently I've been working on an advanced authentication and identity management system for one of my projects. It includes managing users through different drivers, sources, stores, and authentication methods. Some of the users might have roles, others are SSO, etc. In other words - maximum versatility.

To begin with, I must admit that Laravel provides a flexible enough system that allowed me to connect everything together: multiple stores (providers) (relational, no-SQL, and in-memory), including external SSOs. So, that's on the positive side.

However, I faced a huge challenge when working with one particular interface (contract) - Authenticatable (Illuminate\Contracts\Auth\Authenticatable). Basically, it's HUGE. You could check the source; at the current state, it's responsible for at least 3 different (distinct) functions and has little overhead, or "concrete" implementation (if that's allowed to say about an interface).


Distinct functions include:

1. Identify the Authenticatable subject;
2. Getting the password;
3. "Remember me" functionality (getting, setting and rotation of the "remember me" token)

What kind of problems I faced:

1. Not all users have passwords, in particular - SSO.
2. Not all users have "remember me" - when I authenticate users using bearer token (JWT). They don't have passwords either.
3. The "overhead" or "concrete methods" for UsersProvider, getAuthIdentifierName \- is also not applicable to SSO / JWT users. The getAuthIdentifierName basically returns the "column name" or the "key name", of the identifier, while there is a dedicated method getAuthIdentifier that returns just the identifier.

Since I want to integrate my users into the authentication system of the framework, I have to implement the provided interface (Authenticatable), which led me to having most of the methods for different users empty or return null. This led me to question why one of the primary interfaces of the authentication system has so many methods that are not relevant to non-default cases (using SessionGuard with Eloquent UsersProvider). It felt like someone just took the "User" class and converted it into a contract (interface).

What do you think?

https://redd.it/1kp5dhv
@r_php
Is there any tool that changes PHP's syntax?

Like a tool that would let me write $this.variable and it converts it to $this->variable

https://redd.it/1kp9g7k
@r_php
Two or fewer method/function arguments still ideal

What would you say, is the recommendation to give a method or function as few - in the best case two or fewer - arguments as possible still up to date?

I can understand that it is generally always better to use as few arguments as possible. However, this is often not feasible in practice.

I can also understand that before PHP 8, before named arguments existed, it was just ugly to pre-fill unused arguments.

See the following example function:

function font(string $file, string $color = '#000000',int $size = 12, float $lineHeight = 1, int $rotation = 0)
{
//
}

All arguments had to be filled before PHP 8 in order to create a default font with 90 degree rotation in the example.

// before PHP 8
$font = font('Example.ttf', '#000000', 12, 1, 90);

With PHP 8 there are fortunately named arguments:

// after PHP 8
$font = font('Example.ttf', rotation: 90);

This of course improves readability immensely. For this reason, I would say that there is not necessarily a reason to follow this recommendation. Of course, it still makes sense to split the arguments into higher-level objects if applicable. But not at all costs.

As long as there are only 1 or 2 without a default value, readability should still be guaranteed with named arguments. What do you think?

https://redd.it/1kpi29s
@r_php
Introspect for Laravel - Query your codebase like a database with an Eloquent-like API
https://redd.it/1kpoz7z
@r_php
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/1kpoq5b
@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/1kq1t0a
@r_php
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/1kq4h8w
@r_php