Questions tagged [symfony]

Symfony refers to both a PHP framework for building web applications as well as a set of components on which the framework is built. This tag refers to the currently supported major versions 4.x, 5.x, 6.x and 7.x. Alternatively, you can specify an exact version using the respective tag. This tag should not be used for questions about Symfony 1.x. Please use the Symfony1 tag instead.

symfony
Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

symfony messenger how to dispatch message to a specific queue from PHP?

How to dispatch from PHP (without going through MESSENGER_TRANSPORT_DSN=amqp://xxx) ? default is "message" but if I want queue_nameX ? $bus->dispatch($message, [ //new ...
stloc's user avatar
  • 1,528
-1 votes
1 answer
12 views

Implememt logger of frameworks for Queries Log for Rollback in correct transactions (Track Events)

This post is not looking for recommendations, it is looking for the existence of features in the native framework or method to track/log query execution. I have several databases, and I require ...
Francisco Nuñez IA Lover's user avatar
-1 votes
0 answers
16 views

Symfony 7 Multiple Entities does not work correctly

Symfony 7 Multiple Entities does not work correctly. I use Symfony 7 in a test setup with 3 databases. However, the migration does not work correctly. All tables are always created in each database. ...
Thomas Muench's user avatar
0 votes
1 answer
32 views

Symfony type hinting for custom User class

I am trying to get type hinting to work with a custom User class in the Symfony 5.4 Security bundle and PHP 7.4. So I have this User class: // src/Security/User.php <?php namespace App\Security; ...
helmi77's user avatar
  • 109
-1 votes
1 answer
42 views

Why does turbo use http instead of https?

I have a symfony login. My page uses turbo and is served with an ngninx reverse proxy that terminates the https. caddy with frankenphp serves the page over http:80. The problem is that locally when ...
leet's user avatar
  • 497
0 votes
1 answer
18 views

Symfony 7 : Expected argument of type "string", "null" given at property path "Title"

It's mainly a question of understanding, because I've found a solution, but I'm not really convinced. I've two methods, new and edit as shown below : #[Route('film/new', name: 'app_film_new', ...
Cellophile's user avatar
-1 votes
0 answers
42 views

API Platform - override an exception

I am looking at the Error Handling with the newest API Platform version: https://api-platform.com/docs/core/errors/ and "Control your exceptions segment". I am trying to override an ...
Filip Stojanovic's user avatar
-2 votes
0 answers
23 views

Doctrine entity ID does not exists in DB [closed]

We have a Symfony setup with Doctrine and MySql. Some of the logic is processed in workers - for example processing a log entry. In the DB we store an entity - AuditLog. After persist and flush, the ...
ghostika's user avatar
  • 1,499
0 votes
1 answer
16 views

How to Fix 'The metadata storage is not up to date' Error in Symfony with Doctrine ORM and Migrations?

How can I resolve the 'The metadata storage is not up to date' error in Symfony when using Doctrine ORM and migrations? I added a new entity to my Symfony application, and when I ran 'php bin/console ...
Ashraf SB's user avatar
0 votes
1 answer
21 views

Expected response code "250/251/252" but got code "550", with message "550 5.7.27 <[email protected]>: Sender address rejected: Domain exampl

I'm trying to use the mailer service to send emails through Symfony. As my website is hosted on hostinger as well as my domain I am following the following pattern in the .env file ###> symfony/...
Deivid Araújo's user avatar
-1 votes
1 answer
37 views

Checking request requirements in PHP Symfony: Do I have to use services? (OOP vs Services in Symfony)

I'm working on my second Symfony project and trying to follow best practices. I've switched from static methods to services for improved readability and potential performance gains. For instance, I ...
Brentspine's user avatar
0 votes
2 answers
46 views

Fetching my Symfony API takes almost 2 seconds

I fetch my Symfony API on React, and it takes 2 seconds to get and display the data even though there are only 3 lines. How can I optimize time? video: https://imgur.com/a/iGaFW0L During the video ...
Max123456's user avatar
1 vote
0 answers
24 views

Symfony programmatically register excluded service definition / modify existing service definition

Previously, prior to Symfony 6.2, it was possible to dynamically register classes from the user's src directory within a Symfony Bundle. This was achieved by leveraging the applications services.yaml ...
SteNafH's user avatar
  • 29
0 votes
0 answers
22 views

Symfony as API: CORS problem - Stopped propagation

I am currently working on a small project, where a little issue suddenly started arising. Requests from a Frontend, which is also local due to development purposes, started having CORS errors. The ...
Sordep's user avatar
  • 45
0 votes
0 answers
21 views

Update Many-to-Many relation in Api Platform via RESTful

You have two entities: Page and Tags and a Many-to-Many relationship between them. If you want to add tag with id=1 to page with id=1, call: PATCH /api/pages/1 {"tags":["/api/tags/1&...
remy's user avatar
  • 82
1 vote
0 answers
22 views

Symfony Security access_control and jwt auth issue

Issue: I'm encountering difficulties with security configuration in my Symfony application. Specifically, I'm having issues accessing routes protected by access_control. Context: I'm using Symfony to ...
Pyd's user avatar
  • 45
0 votes
1 answer
31 views

Issue when attempting to submit form with a ChoiceType using Symfony

I have the following code which does not work while attempting to submit the form: namespace App\Form; use App\Entity\Status; use App\Entity\Signal; use Symfony\Component\Form\AbstractType; use ...
Fatma Ellouze's user avatar
-1 votes
0 answers
24 views

Neatbeans (21) : how to set project url correctly

I have a php Symfony project opened in Netbeans. I want to set the configuration (right click on the project + set Configuration). You can set the project URL and index file (app_dev.php). Unfortunaty ...
mlwacosmos's user avatar
  • 4,450
0 votes
0 answers
21 views

Data inserted by set in symfony appearing null

Thats my entity Empresa.php <?php namespace App\Entity; use App\Repository\EmpresasRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: EmpresasRepository::class)] class ...
rodrigo's user avatar
0 votes
0 answers
19 views

Testing Symfony bundle working with API platform

I already made a test with a Symfony API project, and it works; now, I am trying to test a Symfony bundle working with the API platform, so I needed to bootstrap the app. But it seems it missed ...
David Bénard's user avatar
0 votes
0 answers
12 views

Symfony Live components Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource

I have a problem and I can't find where the problem comes from after checking my code and the docs. When submitting a form with Live components I do not have a redirection once the data is submitted ...
Gisa's user avatar
  • 1
0 votes
0 answers
18 views

JWT Authentication with Symfony 6.4

I am trying to create an authentication form with Symfony using JWT. I installed the Security bundle, created the User entity, and then installed LexikJWTAuthenticationBundle. Afterwards, I configured ...
Jihed Kh's user avatar
0 votes
0 answers
16 views

Storing ORM metadata, results and queries to predis cache

We have a symfony 2.8 app running (yes, it's old, we are in the process of upgrading). I'm trying to set up our caching for the ORM to use our Redis instances, but I keep getting and Address not ...
Bird87 ZA's user avatar
  • 2,352
0 votes
1 answer
40 views

Symfony SassBundle not recognize the .yaml config

I am working on a Symfony App with AssetMapper & ux-twig-component. To optimize resources at the loading, I made different stylesheets. My main stylesheet is a .ccs template file that I reuse in ...
d3os's user avatar
  • 1
0 votes
1 answer
44 views

Symfony, Messenger, Kubernetes and messenger:stop-workers

My problem is as follows, I have a symfony application. It is dockerized in Kubernetes. One container is a web server, the second is consumer for symfony messenger and the third is symfony messenger ...
Tomek Kobyliński's user avatar
0 votes
1 answer
33 views

How to make Symfony working with tests folders

I would like to add a "tests" folder in Symfony. Here is my composer.json : "autoload": { "psr-4": { "AppBundle\\": "src/AppBundle" ...
Lenwë Galathil's user avatar
0 votes
1 answer
26 views

NotFoundHttpException with ApiPlatform: Custom URL Parameter Treated as Identifier

I'm encountering an issue within my Symfony project that utilizes ApiPlatform. Whenever I include a custom parameter in the URL, I face a NotFoundHttpException with the message "Invalid URI ...
atmacola's user avatar
  • 377
0 votes
0 answers
22 views

Cant load user with LdapUserProvider : Could not complete search with dn

With LdapUserProvider i have some errors when i try to load my user. In this method : public function loadUserByIdentifier(string $identifier): UserInterface { try { $this->ldap->...
CalebDeCoteau's user avatar
0 votes
2 answers
65 views

Type hinting a property with var annotation

In Symfony, if you want to autowire some dependencies in a service, many times you use an interface instead of a concrete class. For example, you might have: public function __construct( ...
Carlos Granados's user avatar
0 votes
0 answers
21 views

Register repository as public service in a bundle

In converting an existing Symfony app to a custom bundle I'm encountering an error caused by custom entity repositories not getting loaded in the container. Debugging the container seems to show that ...
Adam Richard's user avatar
0 votes
1 answer
48 views

Using dot notation in Twig with attribute()

Has any one tried to do something such as {{ attribute(item, 'subItem.title') }} for accessing a structure such as in the following pseudocode: class Item { private $subItem; public function ...
jedi58's user avatar
  • 319
0 votes
0 answers
29 views

Symfony UX and Dropzone : How to download files

I would like to use Symfony UX and the Dropzone component in my project to allow image downloading. Everything seems to work fine. However, I can't get the files in my controller to process and upload ...
MikaelHdx's user avatar
-1 votes
1 answer
19 views

Which cron should I use for Symfony 6.4? I've already tried everything and the versions don't work

Which cron should I use for Symphony 6.4? I've already tried everything and the versions don't work composer.json { "type": "project", "license": "...
Densetsu's user avatar
0 votes
0 answers
25 views

API Platfrom - Customize Error Pages on prod

In my Symfony application, I would like to customize 500 Internal Error messages to direct the user to call them on some action instead of the generic 500 that Symfony displays on PROD env. Meaning ...
Филип Стојановић's user avatar
1 vote
1 answer
41 views

How does composer resolve package names that are not fully qualified as "webapp" or "profiler"?

When you go to a Symfony project (for example created with composer create-project symfony/skeleton:"7.0.*" .) and you run composer require webapp, it will install symfony/webapp-pack. How ...
AndreKR's user avatar
  • 33.3k
1 vote
1 answer
21 views

How to handle attributes for properties in custom serializer?

I have app based on symfony5.4. Inside this app I have a class for client like this: class Client { #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])] public \DateTimeImmutable $...
Andrew Markhai's user avatar
0 votes
0 answers
15 views

Symfony PHPUnit disable custom specific event during testing

PHP8.3 Symfony7.0 Is it possible to disable specific event listeners during ApiTests with PHPUnit? I have searched a lot but i can not figure it out, how this should work. Another option can be also ...
behrus's user avatar
  • 41
0 votes
0 answers
22 views

Copy a symfony project from a laptop to another

I have a symfony project which I have under my Laragon www folder. I would like to copy it to be used by my colleague on his laptop. When we simply copy/paste of the folder to his local, it does not ...
Dev Devoo's user avatar
-2 votes
1 answer
21 views

How to wire two different services, implementing same interface based on environment in symfony 7

I am trying to wire two different Adapter services, which implement the same interface. But still using when@dev clause dont work in this case services: App\Mocks\Adapter\ExampleAdapterMock: ~ ...
Shudhansh Shekhar's user avatar
-3 votes
0 answers
22 views

Using 'LIKE' operator when parameter value only partly matches the field value

I created a method that has a string parameter value and I want to compare this value with field value inside method: private function getVideoEntities(array $scenarioTitles): array { $...
Bernard Polman's user avatar
0 votes
1 answer
21 views

Symfony cache don't work with relations entity

I've used the cache component with Symfony and encountered a problem. When I retrieve my data from the cache, the entities with relationships are not set. Does anyone know how to solve this? $cache = ...
Alberto's user avatar
-1 votes
1 answer
31 views

How to resolve the Composer dependencies conflicts symfony?

I'm writing a PHP application based on Symfony v6.4 and want install a bundle using composer require mybuilder/cronos-bundle But an error appears: Your requirements could not be resolved to an ...
Densetsu's user avatar
0 votes
0 answers
17 views

Using symfony normalizer and doctrine to store value objects in a database column

Suppose I have this doctrine entity: #[ORM\Entity(repositoryClass: MyEntityRepository::class)] #[ORM\Table('my_entity')] class MyEntity { public function __construct( #[ORM\Id] #[ORM\...
johanvio's user avatar
0 votes
0 answers
10 views

API PLATFORM 3 - XML Mapping Open API

I work on API Platform 3 with Symfony 7. I try to map all entry-points with XML but I can't find a good documentation for the XML. I had to map it in XML because all of my entities are mapped in XML. ...
hugoSEIGLE's user avatar
1 vote
1 answer
28 views

Symfony new Logger changes throws exception, deprecated, use HttpKernel's DebugLoggerConfigurator instead

I am using symfony 5 and monolog v3.7 Since yesterday we faced a new exception: #message: "User Deprecated: Since symfony/monolog-bridge 6.4: The "Symfony\Bridge\Monolog\Logger" ...
ali Falahati's user avatar
-3 votes
0 answers
36 views

it is ok to have multiple manytone relationship between two tables [closed]

I have image entity that take two users the first one its role is patient and the second one its role is radiologist I distinguish between them by [role] attribute so I have 2 many to one ...
houssem's user avatar
1 vote
0 answers
45 views

Routing issues with PHP, Symfony and XAMPP on local machine

I recently took over a website from another developer. The website was developed in PHP, a language with which I have no experience, although I am familiar with full-stack JavaScript. The code works ...
axel pothier's user avatar
0 votes
1 answer
27 views

Issue when displaying a dropdown list in Symfony

Am using the following code in order to display a dropdown list from a mariadb database table, however it does not work when testing and it : <?php namespace App\Form; use App\Entity\Signal; use ...
Dev Devoo's user avatar
-1 votes
1 answer
21 views

Two symfony projects with one login

I need a tip please. I have two Symfony WebApps that can be accessed on different subdomains. I basically want to be able to log in to WebApp_A as a user. So far no problem. But now I have links in ...
marcusm's user avatar
0 votes
0 answers
21 views

Symfony : TextEditorType Field not being displayed in my CollectionField in easyadmin

I'm currently working on a symfony project with a easy admin dashboard, I'm trying to add a collection field in to my "Campaign" Entity to be able to add, edit, delete Products. each product ...
Anass igli's user avatar

1
2 3 4 5
1482