Relative Content

Tag Archive for phpsymfony

Symfony MySQL Configuration Issue: Connection Refused despite Correct Credentials

I ‘, learning Symfony but I have a problem with configuration mysql. I’m using this fork https://github.com/Norivo7/symfony-docker and it work’s correctly with phpmyadmin too. I have default data to mysl –
host: 127.0.0.1,
username: dev,
password: dev
I can logged in to this db via MySQK WorkBrench. Problem is that into .env I have configuration like this

How to Modify Symfony Entity Getter Method to Return Date-only Values in REST API Responses?

I’m currently developing a Symfony-based REST API application, where I encounter a specific requirement related to the formatting of date values returned from entity fields. Within my entity, I have a field named birthdate, defined as @ORMColumn(type="date"). When this field is included in API responses, it provides both the date and time components, which is not aligned with the project’s specifications. Instead, I need the API response to exclusively provide the date part without any time information.

CORS dynamic with Nelmio

I would like to have a dynamic CORS with Nelmio to allow people using my API, and protect from unsafe user.
Ex: in my database I have a list of ORIGIN that’s allowed to use it with an X-API-KEY