Questions tagged [symfony6]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 6. Otherwise use only the general [symfony] tag plus the language tag [php].

Symfony is a framework for web and CLI-applications built on top of a catalog of Symfony components. It is free software released under the MIT license. The project's homepage is symfony.com.

Symfony 6 was released in November 2021 and includes several changes compared to its predecessor. However there are no new features compared to version 5.4.

429 questions
0
votes
0 answers

Symfony services eager loading?

I have a interesting situation I have not yet encountered with Symfony... I have a bundle, which provides dynamic configuration to the entire application. I've registered the service of the bundle and it all works. MyNamespace\MyBundle\Site\Vars: …
Alex.Barylski
  • 2,843
  • 4
  • 45
  • 68
0
votes
1 answer

Error with date/time fields in EasyAdmin once deployed on Heroku

I work on a Symfony 6.0.9 website with EasyAdmin to handle the administration panel. I've got an entity ProfessionalExperience with some of its properties that are dates. Its CRUD controller for EasyAdmin looks like this : class…
0
votes
0 answers

Invalid upload directory for EasyAdmin ImageField once deployed on Heroku

I work on a Symfony 6.0.9 website with EasyAdmin to handle the administration panel. I've got an entity User and an entity MediaObject that can be an image for example. The User has a property $profilePicture which is a MediaObject. In EasyAdmin,…
0
votes
1 answer

Symfony 6 ApiKeyAuthenticator with SelfValidatingPassport replaces guard?

I migrating a symfony 5.1 api to symfony 6 with api-platform. My app has it's own user and password logic different to common user database so I had to create my UserRepository and UserProvider. I have created a controller with Login functionality…
Rodrigo
  • 131
  • 1
  • 6
0
votes
0 answers

Symfony 6 base url. Redirect to the public/index.php

I have a symfony 6 application. I used symfony server for development(I regret it now) because I was "recommended". I use xampp so I go to the public (http://localhost:8080/projects/mag6/public/) folder and it goes to the (/) route. But if I go to…
0
votes
0 answers

Symfony 6 does not work in a subdirectory on the server

I need to run the application I wrote with symfony 6 in a subfolder. There will be 2 applications in the same domain. I defined virtual host in .htaccess file but it didn't work. I define rewrite base but it doesn't work. symfony detects the folder…
Azad KAYA
  • 29
  • 1
  • 6
0
votes
1 answer

Check on undefined variable causes fatal error

I'm updating a very old website from a symfony 2 version to a symfony 6 version and I'm rewriting a bunch of the code. I'm encountering a problem when checking a variable that has not be defined. It causes a critical error when I'm expecting a…
And Row ID
  • 169
  • 11
0
votes
1 answer

How json authentication works with symfony?

I can’t figure out what’s blocking. I’ve been following the symfony documentation. /security.yaml security: # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords password_hashers: …
0
votes
0 answers

Symfony - fixtures load throw unexpected error

In my Symfony 6 project, I am trying to load a fixture: /** * @param ObjectManager $manager */ public function load(ObjectManager $manager): void { $manager1 = $manager; $manager1->persist($this->persistCompanyOne()); …
keymon
  • 11
  • 2
0
votes
1 answer

Running a (fresh) custom command in Symfony 6 gives an error

I try to create a custom command which creates a test user in Symfony 6.0.6 (with PHP 8.1). I tried it with creating a custom command with the following console command: php bin/console make:command The command is successfully created under the…
T.Hijd
  • 15
  • 1
  • 8
0
votes
1 answer

how can i build the authentication using symfony 6 and raeact js?

In my App i don t need a registration feature so i added a user in the database manually ,Actually I tried with the LexiJWTAuthenticationBundle i followed the documentation but unfortunately when I use the cURL to send a request i get the…
0
votes
1 answer

How to ignore PHPUnit errors, which do not affect tests, in console?

When I run PHPUnit tests, there are some errors displayed in my console, even though these errors do not affect my tests (they all pass). And it is very annoying to see all these errors displayed errors I tried in phpunit.xml file add the following…
0
votes
2 answers

Symfony 6.0 - Force logout user in controller

How can i force logout user logged from controle on the new Symfony 6 ? (Version 6.0.1) I tried $tokenStorage->setToken($token); but setToken() need 2 args: (public function setToken(string $tokenId, string $token);) I tried…
0
votes
1 answer

Mapping not found on Easyadmin with a relation field and Vich

I'm looking to refactor some code to avoid repetition ;) Bundles used: symfony 6.0.7 vich/uploader-bundle 1.19 easycorp/easyadmin-bundle 4.1.1 I have a Content entity where all content types are defined. The MyImage property is a OneToOne…
Toutma
  • 11
  • 5
0
votes
1 answer

Update Entity with a new field in a controller - Symfony 6

I'm new in Symfony, and I am trying to calculate the average of the customer reviews at the controller level. I did a dump in the foreach shown below, where I have the entity as I want, but in the return of the postman the field I added does not…