74,143 questions
-2
votes
0
answers
28
views
how to handle the proper composer version of Symfony a project on linux [closed]
I am a beginner with Symfony, although I succeeded in working with a demo project on windows. Now I want to redo the whole project on linux with following steps:1
1+ installation lamp server
2+ ...
1
vote
1
answer
64
views
Symfony don't take the specified schema into account
I have an Symfony app I'm tying to migrate from SQLServer to PostgreSQL. The database was on schema dbo on SQL Server, but on PostgreSQL it will be snb.
I changed the connection string in .env but ...
0
votes
1
answer
85
views
Symfony 5 make:entity property relation issue
In Symfony 5, I'm trying to add a new Entity with a relation in it but I think I don't use the command like I should...
When I want to create an Entity I do this:
$ bin/console m:e myNewEntity
Then, ...
0
votes
1
answer
60
views
How to use a custom serliazer when working with Enqueue Kafka with Symfony?
I am using Symfony and Enqueue Kafka to consume a Kafka topic. The problem is that Enqueue doesn't know how to serialize the messages on that topic and it throws a 'Undefined array key "body"...
Advice
1
vote
5
replies
119
views
How do you correctly enforce only one active row per user with Doctrine and PostgreSQL under concurrent requests?
I ran into a design problem in a Symfony + Doctrine + PostgreSQL project and I want to make sure I am solving it at the correct layer.
I have an entity where one user can have many rows, but only one ...
Best practices
2
votes
2
replies
55
views
Can Doctrine dynamically generate inverse OneToMany mappings for multiple entities using one reusable ManyToOne trait on the owning side?
I am using PHP 8 attributes with Doctrine ORM in Symfony.
I want to reuse the same ownership relation across many entities such as Website, Spot, Ad, etc.
My goal is:
use one reusable trait for the ...
0
votes
1
answer
53
views
Redirect old URLS with SEO to new app. Angular + Symfony
I'm having a situation where there is an existing website. It's going to get replaced by a new version made from scratch but I want to use old URL's which will exist for a while to preserve SEO score ...
1
vote
2
answers
116
views
Symfony MapQueryString doesn't allow optional parameters
I have a simple endpoint which has optional query parameters used for filtration. In my controller I use MapQueryString to map them to a DTO and validate inside. The problem is when I call the ...
-1
votes
1
answer
141
views
Laravel Symfony Mailer: Unable to connect with STARTTLS due to Peer Certificate Hostname Mismatch (HIN.CH SMTP)
I am using Laravel 10 (Symfony Mailer) to send emails via the HIN.CH SMTP server. However, I am consistently getting a TransportException regarding an SSL certificate hostname mismatch.
The Error:
...
0
votes
1
answer
146
views
PHP Intelephense doesn't detect symfony repository functions
I've recently started using PHP Intelephense (absolutely love it), but one issue that persists. I code within the PHP Symfony framework and will get a red like so:
"findExistingCartOrder()" ...
-1
votes
1
answer
70
views
Doctrine PingableConnection replacement for Postgres
In long running processes with the symfony scheduler we had the problem, that the DB connection got lost and was not refreshed.
Our Database is Postgres.
Doctrine DBAL used to have a ...
Advice
0
votes
2
replies
160
views
How to replace a placeholder with an image in PHPWord (Symfony) when generating a PDF?
I am working on a Symfony8 project where I use the PHPWord library to generate documents. Currently, I am using the TemplateProcessor to replace text variables using the ${variable} syntax in a .docx ...
Best practices
1
vote
1
replies
78
views
How to get an `AutowireIterator` in tests?
In a Symfony application, I want a test that runs against every implementation of an interface or abstract class.
Example
I have a TitleBuilderInterface (file: src/Service/TitleBuilder/...
1
vote
1
answer
44
views
Getting exception while trying to get controller_resolver intance in sonata crud controller
I have a custom batch actions. And when i use this action in my admin panel, im getting exception.
In this block of code in CRUDController:
$exists = false !== $this->container
->get(...
0
votes
0
answers
42
views
Symfony UX Cropper + LiveComponent always returns full image
Symfony UX Cropper + LiveComponent always returns full image (width/height null)
I’m using Symfony UX CropperJS inside a LiveComponent and the cropper UI works correctly (I can move/resize the crop ...