PHP Reddit – Telegram
PHP Reddit
33 subscribers
293 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
Blasp v2 Release

Hey Laravel Devs

Last year, I created and released Blasp, a profanity filter for Laravel. To my surprise, it’s now grown to over **200 GitHub stars** and **18K downloads**—definitely not what I expected!

Shortly after launching, my wife and I welcomed our daughter into the world, so I’ve been off the grid for a bit. During that time, I received a lot of messages about **issues and feature requests**, so I decided to put together a **v2 release** to make Blasp even better!

# 🔥 What’s New in v2.0?

🚀 **Caching System for Improved Performance**

* Profanity expressions are now cached for faster repeated checks
* Added `php artisan blasp:clear` command to clear cache

**New** `configure()` **Method for Custom Lists**

* Define **custom profanity lists** and **false positive lists**
* Example usage: `$blasp = Blasp::configure( profanities: $your_custom_list, falsePositives: $your_custom_false_positives )->check($text);`

🔧 **Refactored Configuration**

* Supports **custom lists & cached expressions**
* More structured and flexible configuration options

⚙️ **Breaking Changes**

* **Removed language support** for better maintainability
* **Updated method signatures** for configuration
* **New config structure** (migration guide included)

view the full notes here [https://github.com/Blaspsoft/blasp/releases/tag/v2.0.0](https://github.com/Blaspsoft/blasp/releases/tag/v2.0.0)


Enjoy and will look forward to any feedback!

https://redd.it/1izfi8h
@r_php
What websocket solutions you use in your PHP project, and why?

Hi there, I'm curious to see what websocket solutions other devs use for their applications, and why (tradeoffs). What are your use cases?

https://redd.it/1izkuxv
@r_php
From Laravel to Symfony | Day 1

Continuing my series on transitioning from Laravel to Symfony, today I’m exploring configuration, Doctrine ORM, and database migrations. If you missed the first part, you can find it here:

From Laravel to Symfony | Day 0

So, I spent time diving into Symfony’s configuration system, Doctrine ORM, and database migrations. While some things felt intuitive, others were quite a shift from my Laravel mindset. Here’s how it went:

# 1. Configuration

I have to admit—configuration in Symfony feels overwhelming at first. I’ve worked with YAML before, but not knowing all the possible parameters and options makes it a bit intimidating. Hopefully, over time, this will start to feel more natural.

One thing that caught my attention is Symfony’s use of URI-like configuration strings. It’s interesting because, on the one hand, it condenses multiple parameters into a single string. But on the other hand, packing 3, 5, or even 10 parameters into one value makes it feel dense.

Also, I’m still wondering—why is YAML the default configuration format? Symfony supports XML and PHP, but YAML seems to be the recommended approach. Maybe there's a historical reason for this choice, but personally, I find PHP-based configuration more readable and maintainable.

# 2. Doctrine ORM and Entity Manager

This will probably be the longest (and most frequent) topic in this series. Doctrine’s architecture is very different from what I’m used to, and, to be honest, it feels uncomfortable right now.

Entity Mapping: Doctrine’s approach to entity mapping via the Reflection API is intriguing. It avoids direct manipulation of objects, which adds safety. However, I’m curious if managing the required PHP attributes for entity configuration will become overwhelming. Compared to Eloquent’s "Active Record+" pattern, where models manage themselves, Doctrine seems more structured but also more verbose.
Column Naming Freedom: One small but nice benefit—Doctrine doesn’t impose restrictions on column names like Eloquent does ($fillable, $timestamps, $table, etc.). These conflicts are rare but can be annoying when they happen.
Setters & Getters: I don’t love them. It feels like stepping back into the early 2000s, where this was the standard approach. With PHP 8.4 introducing asymmetric visibility, I hope defining explicit setters and getters won’t always be necessary unless additional logic is required. That said, I do appreciate how Doctrine forces explicit property definitions, making it more IDE-friendly compared to Laravel models, where attributes are often inferred.
Relations: Doctrine’s handling of relationships is super-explicit. You have to define properties, write appropriate getter/setter methods, and manage the association manually. Compared to Laravel, where a relation is just a single method, this feels like extra work. However, on the flip side, Doctrine ensures that these relations are explicitly modeled and available to the IDE as properties, rather than relying on Laravel’s "magic" attribute resolution.
PHP Attributes: I generally like PHP attributes, and they seem like a natural fit for the modern framework. But I wonder—what happens when an entity requires a large number of attributes? Will the attribute annotations eventually become more complex than the actual "classic" logic?
Working with Entities: This part feels overcomplicated. To perform basic CRUD operations, I have to juggle three different objects: Entity Manager (for persisting changes), Repository (for fetching data), and Entity (the actual object being modified). In contrast, Laravel’s "Active Record+" approach bundles everything into a single model, which feels more practical for day-to-day use.

# 3. Database Migrations

Migrations in Symfony feel different from Laravel, and honestly, I think Laravel’s approach is more intuitive.

Symfony provides a fast way to generate migration files based on entity changes, but you
still have to manually edit them most of the time. Laravel, on the other hand, follows a "schema-as-code" approach—each database change is defined in PHP using a structured API. This makes migrations more readable and easier to modify.

# Final Thought: "Magic" in Laravel vs. Symfony

As a Laravel developer, I’ve often heard the criticism that Laravel relies too much on "magic." But after exploring Symfony’s Doctrine ORM and Dependency Injection, I’d say Symfony has its fair share of magic too—it just uses different terminology:

Symfony’s "magic" comes from Reflection API & Autowiring.
Laravel’s "magic" comes from Facades & PHP’s Magic Methods (__call, __get**)**.

So, in terms of "magical behavior," I’d say the score is 1:1. Each framework abstracts complexity in its own way, and it all comes down to preference.

That’s it for today! Next, I’ll be diving deeper into Symfony’s routing and request handling. Let me know if you have any insights or experiences with Doctrine—especially if you’ve transitioned from Laravel like I have!

https://redd.it/1izrt2g
@r_php
Why did you write your own framework?

I'm curious to those who have written their own framework.

1. Do you still use it?

2. What features did it have?

3. What was the advantage of your framework over a more populair option?



I have a sideproject framework, that is used in 4 production applications. It has its own HTTP client. CLI/HTTP router. Fully functional (but slow....) ORM. While project setup and troubleshooting are a breeze, the features that a (professionally) maintained framework offers is unmathed. I'm attempting a rewrite currently, hoping mainly to fix the querybuilder.

https://redd.it/1iztyci
@r_php
Php is really good

I used a lot of language and frameworks -

Ruby on rails
Laravel
Django

But i wanted to build a website from scratch, so i will learn php now. Honestly feels very great. Most of my fav websites use php(custom framework or simple php). It feels fresh again. The best langauge to build websites from small to big. Php + go is what you need and you can build anything.

https://redd.it/1j0368s
@r_php
Shipping with Laravel

Firstly, thank you to everyone who engaged with and saw my “I want to give back” post. I spent some time dumping my brain onto words and coming up with this written post. I’m also super excited about the timing of this and what Laravel Cloud brings to the ecosystem.

I hope this post helps some of you who are trying to ship your applications—whether you’re just starting out or already deep in the trenches. While this is the first, beginner-friendly post, I’ve designed it to be useful across different skill levels and should be updated as time goes on.



Today, I’m happy to share the first look at the written post on Shipping with Laravel:
https://james.buzz/blog/shipping-with-laravel/

TL;DR: My biggest lesson; Things fail all the time. You need to spot these failures quickly and resolve them without breaking anything else.



If you have any suggestions or insights, please share them. And if you think I’ve missed anything or something could be corrected, let me know and I'll check it ASAP.

https://redd.it/1j04201
@r_php
PingCRM with React, Inertia, SSR, Reverb Websockets and i18n

Hello everyone! With all the hype surrounding the release of Laravel 12, I wanted to share an old project that I recently migrated in the style of the recently released starter kits.
I added some crud and a reverb demo.

# What is it?

This is an adaptation of the classic PingCRM demo for, originally created by Jonathan Reinink (original Vue.js version), later ported to React by Lior Rocks (React version).

GitHub: https://github.com/fouteox/pingcrm-react-inertia-laravel

# Why another PingCRM?

I know there are plenty of starter kits out there, but this isn't trying to be one. Instead, it's a comprehensive demonstration of several modern Laravel features working together:

Laravel 12 with [Inertia.js v2](https://inertiajs.com/) and SSR
React 19 with TypeScript
Tailwind v4 with shadcn components
Full internationalization with i18next (EN/FR)
Real-time notifications with Laravel Reverb
Background jobs with Horizon
Task scheduling
High-performance Octane + FrankenPHP setup

# Easy to try

Just install DDEV and run:

git clone https://github.com/fouteox/pingcrm-react-inertia-laravel.git

cd pingcrm-react-inertia-laravel

ddev start && ddev launch

The entire environment will be set up automatically, including dependencies, database, queue workers, websockets, etc.

# Learning from feedback

About two weeks ago, I posted about Fadogen, a development environment generator. The top comment was basically: "Why use this instead of official Laravel installers?"
I took that feedback to heart. I've been working hard to make it fully compatible with Laravel 12 starter kits.

But beyond that, I'm working on making deployment as easy as initializing a project.
And I'm almost done!

Soon, you'll be able to deploy your application to a Raspberry Pi behind a Cloudflare tunnel with an automated process similar to initializing a development environment.

My goal, in my humble little way, is to try to build an ecosystem that simplifies the entire process, from initializing a project to going live.

Thanks for taking the time to check this out. I've tried to incorporate the feedback from my previous post and continue improving. And sorry for any language mistakes - English isn't my native language!

https://redd.it/1j052ij
@r_php
What would you change in Laravel?

Inspired by the complaints in the thread regarding starter kits, and my offhand comment about a fork, I started to wonder, what others dislike about Laravel.

If you had a magic wand and you could change anything in the Laravel architecture or way of doing things, what would you change?

And just for the record, I very much ❤️ the framework.

https://redd.it/1j06964
@r_php
Issue 51 of A Day With Laravel : TailDrops, Security Tip: Don't Roll Your Own Crypto!, Laravel VS Code Extension, Initializer and Laravel — Bester Practices are discussed

https://preview.redd.it/tdm5drufbvle1.jpg?width=1280&format=pjpg&auto=webp&s=944d62dc8968f0b7682d7dcfba757df5b3d0a93d

Hey Laravel friends 🤟,

It's time to a new issue of ‘**A Day With Laravel**’, which presents in a very short format some Laravel news.


In this issue we will talk about :

* **TailDrops** by John Champ
* **Security Tip: Don't Roll Your Own Crypto!** by Stephen Rees-Carter
* **The Laravel VS Code Extension is (officially) HERE** by u/joshcirre
* **Initializer for Laravel** by Niclas
* **Laravel — Bester Practices** by tontonsb


I really hope this free content brings value to you.

Let me know in comment what do you think about it.

See you on the next issue.

[https://go.itanea.fr/adwl51](https://go.itanea.fr/adwl51)


https://redd.it/1j05wpd
@r_php
What are different fetch modes in PDO?

I am trying to learn PDO using PHP official manual, phpdelusions and severl other sites found from Google, but all the time I face new concepts, for example cursor.

Now I know only that different fetch modes exist, but that is all. No any explanations why they exist or when to use each.

Also what fetch and query mean and how do they differ between each other? I can only find some library or SDK related things (I guess next I need to learn some set theory).

https://redd.it/1j0gtcl
@r_php
About Inertiajs scaling

Is anyone using Inertia.js with 1K-2K concurrent users? Any issues with slow reloads or performance? Is it more expensive than an API approach?

I'm currently exploring how well Inertia.js scales for high-traffic applications. I’ve heard mixed opinions and wanted to get some real-world insights.

Right now, I have a news platform built with Laravel (API) + Nuxt, handling 2K min – 10K max concurrent users (avg ~5K). It works well, but I was wondering if Inertia could have been a solid alternative.

For those using Inertia at 1K-2K+ concurrent users, did you notice any performance bottlenecks or slow reload times compared to a traditional API-based approach? Also, does it end up being more expensive in terms of server costs since Laravel is handling more rendering instead of just returning JSON?

Would love to hear from anyone who has scaled an Inertia app to a large user base!

https://redd.it/1j0jm5u
@r_php
Pining for the Fjords (of Laravel)

With Laravel 12, Cloud, the new starter kits, mass hysteria and confusion, the community up in arms, etc., my sense is a lot of you are [pining for the fjords](https://www.youtube.com/watch?v=4vuW6tQ0218) of Laravel. Pine no more! You're just 7 commands away from Laravel 12, Bootstrap 5, and auth\*! This is the all joy, no soy OG Starter Kit that my grandma used back in '18 and I'm sharing her secret recipe here for your enjoyment!

composer create-project laravel/laravel your-project-name
cd your-project name
composer require laravel/ui
php artisan ui bootstrap --auth
npm remove @tailwindcss/vite tailwindcss
npm install
php artisan serve

That isn't very DRY, so I even had gippity whip you up a bash noscript so you can use it for all your side projects!

#!/bin/bash

# Exit on any error
set -e

# Store project name from argument or use default
PROJECT_NAME=${1:-"your-project-name"}

echo "Creating new Laravel project: $PROJECT_NAME"
composer create-project laravel/laravel "$PROJECT_NAME"

echo "Changing directory to $PROJECT_NAME"
cd "$PROJECT_NAME"

echo "Installing Laravel UI package"
composer require laravel/ui

echo "Setting up Bootstrap authentication scaffolding"
php artisan ui bootstrap --auth

echo "Removing Tailwind related packages"
npm remove @tailwindcss/vite tailwindcss

echo "Installing npm dependencies"
npm install

echo "Starting Laravel development server"
php artisan serve

Make a directory for all your about-to-be-insanely-productive-and-successful side projects. Create a file in that folder's root called og-start.sh and run it as:

`og-start.sh good-vibes-only`

Bonus! Add that puppy to your bash profile as an alias:

echo
'alias ogs="og-start.sh"' >> ~/.bash_profile && source ~/.bash_profile

Then run it with:

`ogs good-vibes-only`

Let's get back to our roots and ship! Have a great weekend everyone!

\* ^(PHP) ^(and) ^(node) ^(required,) [^(jQuery)](https://jquery.com/download/) ^(optional) ^(but) ^(recommended,) ^(OP) ^(not) ^(responsible) ^(for) ^(injury,) ^(loss) ^(of) ^(life,) ^(or) ^(developer) ^(ridicule)

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