PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Wishlist: Be able to use the latest versions of various services (like Postgres, Meilisearch, Typesense, Redis, etc.) in Herd, Forge

I happily use Herd Pro and Forge, but I was just noticing that the services (Meilisearch, Typesense, Redis) offered through Herd tend to be versions that are mostly a year or more out of date.

I've run into similar thoughts in the past with Forge, specifically when looking at Postgres and whether there was any supported way to set up/upgrade to a version newer than 16.

I'm not sure how much of a priority this is for the team, but there are some nice features to take advantage of in the latest versions of these things, and of course you can just install/upgrade them on your own but it would be nice to be able to have official support for this through the paid offerings.

https://redd.it/1mtoqrb
@r_php
Vizra ADK - AI Agent Development Kit for Laravel

Vizra ADK is a comprehensive Laravel package for building autonomous AI agents that can reason, use tools, and maintain persistent memory. Create intelligent, interactive agents that integrate seamlessly with your Laravel application.

# Key Features

* **🤖 Multi-Model AI Support** \- Works with OpenAI, Anthropic, and Google Gemini + more, thanks to prism PHP
* **🎯 Sub-Agent Delegation** \- Agents can delegate tasks to specialized sub-agents
* **🛠️ Extensible Tool System** \- Give agents abilities to interact with databases, APIs, and external services
* **🧠 Persistent Memory** \- Agents remember conversations and learn from interactions across sessions
* **🔄 Agent Workflows** \- Build complex processes with sequential, parallel, conditional flows and loops
* ** Execution Modes** \- Multiple trigger modes: conversational, scheduled, webhook, event-driven, and queue jobs
* **📊 Evaluation Framework** \- Automated quality testing framework for agents at scale with LLM-as-a-Judge
* **💬 Streaming Responses** \- Real-time, token-by-token streaming for responsive user experiences
* **📈 Comprehensive Tracing** \- Debug and monitor agent execution with detailed traces
* **🎨 Web Dashboard** \- Beautiful Livewire-powered interface for testing and monitoring
* **🔧 Laravel Native** \- Built with Laravel patterns: Artisan commands, Eloquent models, service providers

# 🚀 Quick Start

# Install via Composer
composer require vizra/vizra-adk

# Publish config and run migrations
php artisan vizra:install

# Create your first agent
php artisan vizra:make:agent CustomerSupportAgent

# Start chatting!
php artisan vizra:chat customer_support

You can find out more about it at [https://github.com/vizra-ai/vizra-adk](https://github.com/vizra-ai/vizra-adk)

I'm happy to answer any questions about it so feel free to ask.

https://redd.it/1mtn9ia
@r_php
Are DTO and entities the same thing ?

Hello,


I'm used to dev with DDD and CQRS with different usage of DTO, ValueObject and entities. I heard someone saying that actually DTO is the deprecated version of entities and that the only Domain and only Layer in Web applications is Web which has two consequences according to him :

\- Use Entities to replace DTOs

\- Never do DDD in Web be cause it is non sense


What do you think ?

https://redd.it/1mtr13y
@r_php
clean af, a Vue starter kit for Laravel that's minimal on purpose

I love the Laravel starter kits, but I always end up ripping stuff out and rearranging tons of things before I can get started. I always wanted just a clean starter kit that has the basics, but no components or structures by default. This is why I made clean af.


This kit uses Fortify for auth, which includes the 2FA implementation that you can configure.

Minimal tailwind styles in app.css that can be removed when you implement your own design system.


No components or anything by default, just bring your UI library of choice and hopefully it's easier for you to get setup.

Pull requests welcome if you have ideas on making this even cleaner!


Try it here \- thanks!

https://redd.it/1mtum3l
@r_php
How to get environment variables in MCP server

Hi devs, I'm trying to create an MCP server to make agents able to interact with my product. To do this the server must receive an API_KEY from the client.

I looked at many different libraries but I couldn't figure out how to do it.

This should be a valid client configuration:

{
"mcpServers": {
"php-calculator": {
"command": "php",
"args": ["/absolute/path/to/your/mcp-server.php"],
"env": {"API_KEY": "xxxx"}
}
}
}

How can I get the API_KEY on the server?

I also opened a question in the main PHP and Python libraries but no answers.

https://github.com/php-mcp/server/issues/61

https://github.com/modelcontextprotocol/python-sdk/issues/1277

Someone with experience with that?

https://redd.it/1muakv1
@r_php
Pitch Your Project 🐘

In this monthly thread you can share whatever code or projects you're working on, ask for reviews, get people's input and general thoughts, … anything goes as long as it's PHP related.

Let's make this a place where people are encouraged to share their work, and where we can learn from each other 😁

Link to the previous edition: /u/brendt_gd should provide a link

https://redd.it/1muc8ez
@r_php
How hard it is to find a remote Laravel job?

I have lots of freelancing experience and have built my own products, but I’ve never worked at a company.

I think that’s a setback for most places reviewing my resume, since I get rejected immediately, and on top of that, finding Laravel jobs on job boards is really tough compared to TS or Python.

So I’d like to know your thoughts, what was your experience getting a Laravel job?

I honestly enjoy Laravel, but job market is tough!!

https://redd.it/1mue8we
@r_php
What is/would be the best in application debugging experience?

I am currently working on an overhaul for our internal debugging tool, that functions similarly to the php debugbar, and wondered what opinions people have about this style of debugger (most of the devs here dont have xdebug installed).

Is there a particular debugger you prefer using? IMO the symfony debugger is the best by far, the data collected and its presentation is not overwhelming but rich with information, but am interested in others thoughts

https://redd.it/1mukhi1
@r_php
Laravel VScode setup

I’m new to php and Laravel, how do you configure your vscode? Somehow I’m not even getting HTML emmet to work in blade components. Also autocompleting for Laravel or php is not working that well even for formatting.

My current extensions setup:

Laravel Blade Snippets -> Formatting,
PHP Intelephense,
Laravel official extension

https://redd.it/1mun3h2
@r_php
How to store User-Submitted API Keys

Hi,

I’m currently building a web application prototype using Symfony 7. In their accounts, users can add an API key so the application can connect to an external API and fetch some personal data.

My question is: What’s the best way to securely store these API keys submitted via a form? I don’t want to store them in plaintext in the database, and I can’t encrypt them like passwords because I need the original value to make API calls. I’ve been experimenting with Symfony’s Sodium Vault in my service to create secrets, but I’m not sure if this is considered a best practice.

Do you have any suggestions or insights on how to handle this securely?

https://redd.it/1muuay2
@r_php
Stupid question about safely outputting user or db input

Ok, I'm an old coder at 66. I started a custom ecommerce site in 2005. A LOT has happened since then and there's a lot to keep up with. Yeah, I can just get something better, more robust, and safer off the shelf. But I really enjoy exercising my brain with this stuff. And I love learning.

Here's a thought. If I have some user input from a form or database, it's essential to sanitize it for output to avoid XSS. Why doesn't PHP evolve to where ECHO already applies htmlspecialchars? So just:

$x = "Hello world";
echo $x;

isn't in the background doing echo htmlspecialchars($x);?

Or how about echo ($x,'/safe'); or something like to specify what echo should do?

It seems overly verbose to have to output everything like this:

echo htmlspecialchars($x, ENT_QUOTES, 'UTF-8') ;

Just a thought.

https://redd.it/1mv1rp9
@r_php
Is there a way to enable Pest output while tests are running?

I'm using Pest for tests on a new project. I was surprised to see that when I run Pest, there is no output until the tests have completely run. I would expect dots or the noscripts of the tests to display while running, but nothing. If I use --debug, then I see a ton of information, but that's not what I want. Ideally I'd love to see the test names as they run. I've tried disabling output buffering and also chatted with ChatGPT and Claude about this and they were unable to provide any help other than making stuff up. Any ideas how I can make test names appear as they are running?

https://redd.it/1mv3gg1
@r_php
Variable "locale" does not exist

Hi! I’m pretty new to Symfony and, although I’m in love with this language, it’s been driving me crazy for several days because of a variable that “doesn’t exist” even though I clearly defined it in my controllers. The weird part is that it doesn’t happen in all my files, and despite using AI on the side to try to figure it out, I just can’t find the issue — I’m begging you, please save me!

Here’s the situation: I have two controllers, a HomeController and a HomeAdminController. The first one works perfectly, since I can switch from English to French without any problem. BUT when I’m on the admin side — disaster! The variable suddenly “doesn’t exist” anymore, even though it’s written in plain black and white. And I just can’t switch from English to French there. That’s what really drives me crazy, because only 3 files have this issue! Not the others!!

https://redd.it/1mv8cug
@r_php
What is the best way to learn Symfony from 0 today?

Hello! I hope you are well, I have a little experience in programming but with node, some REST API, the typical... But soon they may offer me a job for newcomers who use Symfony, I like to go to places prepared so as not to have surprises. I would be very grateful if the community could give me their opinion on the best way to see this technology from scratch. I have seen good opinions about Symfonycasts but I have only found references to that page from four years ago, I don't know if it is still as recommendable today.

Thank you all very much 😊

https://redd.it/1mv9406
@r_php
Silent anonymous registration - is it possible?

Hello! I want to start a service where new web site visitors are being assigned new user id in the system silently. This way the registration form won't stop them from accessing payments and paid functionality. User may add and verify phone/email any time, if the phone/email is already registered then all the user's activity will be switched to the existing user in the database after the verification.

Switched user will be deleted from the system. Anonymous/unconfirmed users will be deleted after a month (or three) of inactivity.

Does Sympfony support this functionality?

edit: apparently it was available until 5.1 version

https://symfony.com/doc/4.4/images/anonymouswdt.png

https://github.com/symfony/symfony/discussions/48650

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