PHP Reddit – Telegram
PHP Reddit
34 subscribers
288 photos
36 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
I'm excited to announce the release of Commenter (comment/reply system) v4

**Features**

* 📌 Ability to pin comment/message,
* 😊 Emoji support for reaction icons,

**Improvements**

* 🎨 Design,
* 🌙 Dark mode,
* 📱 Mobile responsiveness,

**Upgrade**

* Tailwind,
* Vite,

Bug fixes and more...

[https://github.com/Lakshan-Madushanka/laravel-comments/releases/tag/4.0.0](https://github.com/Lakshan-Madushanka/laravel-comments/releases/tag/4.0.0)

https://reddit.com/link/1oi2clz/video/shh7y10ussxf1/player

https://redd.it/1oi2clz
@r_php
PHP / Open Source Survey

Disclaimer: I work for Perforce Zend.


Calling #PHP developers: The 2026 State of Open Source Survey needs your technical perspective. Help us analyze enterprise #OSS adoption patterns and PHP ecosystem evolution.
Plus, for every 500 responses we receive, we'll increase our donation to open source initiatives by $1K 
Take the survey here: https://www.surveymonkey.com/r/7X93W9R

https://redd.it/1oibzkd
@r_php
Carbon 2 to Carbon 3 migration

I recently migrated my PHP application between versions of Carbon (as a part of another migration). What has been very painful is the change of the diffIn* methods.

The $abs parameter existed in both Carbon 2 and Carbon 3, BUT the default changed:

Carbon 2.x:
diffInSeconds($dt = null, $abs = true) // Default: absolute value

Carbon 3.x:
diffInSeconds($dt = null, $abs = false) // Default: signed value

Two questions:
1. I understand that there is a major version change that means that there might be breaking changes. But are there any ideas or explanations why has the default behavior been inverted without any good reference? For example, a parameter name might have changed to indicate this.
2. What would be a correct and the best way to detect such changes during the migrations apart from obvious rtfm and proper testing?

https://redd.it/1oidmhz
@r_php
Implementing Type Safety for PHP Arrays

Had a lot of thoughts swirling in my head lately about arrays, and wanted to try some different approaches in contrast to what I've come across. Wrote this article primarily as a brain dump. What are some other approaches better or different that you've come across that should be considered other than generics and SPL?

https://codefyphp.com/docs/blog/2025/10/28/type-safety-php-arrays/

https://redd.it/1oirr94
@r_php
I have made a Laravel based Artisan Command Executer. Wouod it be of any value?

Its a tool to execute Laravel Artisan commands directly from your browser, eliminating the need for SSH or terminal access. Built with Laravel 12, Tailwind CSS (via CDN), and jQuery, this project offers a user-friendly interface for developers to streamline their workflow. It is particularly helpful for sites hosted on shared web hosting without SSH access, enabling seamless use of Laravel Artisan command features.

🚀 Features

Run Artisan Commands: Execute any Laravel Artisan command via a simple web interface.

Common Commands Dropdown: Quickly select from a list of frequently used commands.

Instant Action Buttons: One-click buttons for generating models, controllers, middleware, seeders, and factories.

Command History: View a detailed log of executed commands with their outputs.

Confirmation Prompts: Safe command execution with SweetAlert2 confirmation dialogs.

Responsive Design: Built with Tailwind CSS for a modern, responsive UI.

AJAX-Powered: Seamlessly run commands and update the UI without page reloads.

https://redd.it/1oj265a
@r_php
Is AI actually helpful in PHP coding if the generated code doesn’t match exactly what we need?

I’ve been experimenting with AI tools for PHP development. Sometimes the AI-written code looks correct but doesn’t work as expected or needs heavy tweaking.

Has anyone here found consistent ways to make AI output more accurate for real-world PHP projects?

https://redd.it/1oj1sd8
@r_php
Is it a common practice to import first a db dump and then run migrations?

In a Symfony project I am trying to introduce migrations with its history. I tried to create migration from scratch like this:

#! /bin/bash

SCRIPTPATH="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"

git checkout master
git pull origin master

git branch -d task/QDS-5421-introduce-migrations
git checkout task/QDS-5421-introduce-migrations

# Remove all migrations
cp -r ./migrations ./migrations.orig

# Recreater DB
php bin/console doctrine:database:drop --force
php bin/console doctrine:database:create

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

# Create migration that populates initial data
php bin/console doctrine:migrations:generate

# Populate generated migration with data

# Introducer staging changes
git checkout test
git pull origin test
git checkout task/QDS-5421-introduce-migrations
git merge test

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

bash ${SCRIPTPATH}/import_test.sh

# Tool to modify migration's SQL in rder to avoid migration breaking

# Introduce dev changes

git checkout development
git pull origin development
git checkout task/introduce_migrations
git merge development

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

git add .
git commit -m "Renew Migrations"


Then I would version the nessesary migrations via:

php bin/console doctrine:migrations:version


But I find it impractical because:

1. If I try to run them upon actual Db creation of constraints fail upon creation or removal.
2. During work I would get interrupted via various tasks, thereforeit is impractical to re-write history, not to mention that this task has the lowest (as usual) priority.
3. Coleagues continue to add migrations like this:
     php bin/migrations doctrine:migrations:diff

Then manuallt open the generated migration file and run the gnerated sql by hand during deployment. Afterwards they commit the file.

So I am looking a way to reintroduce them. In order to do this I thought top initiaqlize the db migrations like this:

1. Remove any existing migrations
2. Import staging Dump
3. Generate a migration like this:
    php bin/migrations doctrine:migrations:diff

It is a practical approach though. Do you usually import an initial dump and then run migrations upon upon actual production systems as well?

https://redd.it/1oj9u3i
@r_php
My little laravel built tool is live on product hunt

Hi today mi litle tool, an api for random images is live on product hunt, it is built with laravel and allows to recover a random image. You can use it in many ways, inside server side or just inside a html img tag.
Product hunt link.
https://www.producthunt.com/posts/random-images-api

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