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
5
votes
1 answer

Symfony ignores / does not override values by .env.local file

Using latest Symfony 6.1 and documentation says .env.local overrides values which are set in .env This is not working for me, i.e. when the value is set in the .env, it is not overwritten by the value from the .env.local. When it is not set in .env,…
Luboš Remplík
  • 526
  • 5
  • 10
5
votes
1 answer

Named Routes in Symfony 6 with controllers in inner directory

I moved all my controllers to /src/Web/Controller in my Symfony 6 project like follows ├── src │ ├── ... │ └── Web │ | ├── Controller │ | ├── .... | |── Kernel.php my routes.yaml is modified accordingly #routes.yaml controllers: …
Shobi
  • 10,374
  • 6
  • 46
  • 82
4
votes
1 answer

The entrypoint (public/index.php) in Symfony 6 - how it works?

So the entrypoint file in the Symfony 6 framework (public/index.php) has a construct which I don't understand. Below is the whole content of the file:
r34
  • 320
  • 2
  • 12
4
votes
3 answers

How can I mock the Symfony mailer during testing?

I am using the Symfony mailer in a custom class in a Symfony 6 project. I am using autowiring through type hinting in the class's constructor, like so: class MyClass { public function __construct(private readonly MailerInterface $mailer)…
thorndeux
  • 307
  • 2
  • 9
4
votes
4 answers

Routing Annotations in Symfony 6 are not working

i'm running a symfony application on Homestead, but when adding a route by annotation for simple action it doesn't work. namespace App\Controller; use Symfony\Component\Routing\Annotation\Route; use…
Badr MOUMOUD
  • 166
  • 2
  • 10
3
votes
0 answers

"composer recipes:update" inside a Docker PHP container triggers "fatal: not a git repository"

I'm upgrading an app from Symfony 5.4 (PHP 7.4) to Symfony 6.0 (PHP 8) with the help of this guide: https://symfonycasts.com/screencast/symfony6-upgrade/framework-bundle-recipe I managed to get the 5.4 app to run properly on my Dockerfile's FROM…
Aislinn
  • 73
  • 6
3
votes
0 answers

"AuthenticatorInterface" not found on Security\Guard, Symfony 6.2

I'm trying to create a custom Token authenticator for my Symfony 6.2 and API Platform project class TokenAuthenticator extends JWTTokenAuthenticator { /** * @param PreAuthenticationJWTUserToken $preAuthToken * @param…
sayou
  • 893
  • 8
  • 29
3
votes
1 answer

API Platform - Subresources: Cannot use reference for lookup or graphLookup: dbRef references are not supported (MongoDB-Symfony6.2)

I am currently working on programming a website using Symfony version 6.2 and API Platform in addition to MongoDB (version v6.0.3) in the database. I try to use the Subresources and I followed the official documentation of the API Platform:…
sayou
  • 893
  • 8
  • 29
3
votes
0 answers

How to use ValueResolver in another ValueResolver or chain ValueResolver with Symfony

I'm using Symfony 6.2 with php 8.1. Since the update of SF 6.2 i had to remove SensioFrameworkExtraBundle and migrate my code from ParamConverter to new custom ValueResolver. However, i'm facing a lack a feature from this migration or i miss…
Rady
  • 51
  • 3
3
votes
0 answers

Are anonymous inline invokable factories possible with Symfony?

I can define anonymous inline factory (Symfony 6+) like this: GuzzleClient1: class: GuzzleHttp\ClientInterface factory: [ !service { class: 'App\GuzzleClientFactory', calls: [ { 'withBaseUri': [ 'http://example.com' ] } ] }, 'build' ] or…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
3
votes
1 answer

Symfony 6 is security.enable_authenticator_manager a redundant setting?

I have an authenticator class which extends AbstractLoginFormAuthenticator and I declared it with the security.firewalls.main.custom_authenticator setting. However, I omitted to set the security.enable_authenticator_manager setting - but everything…
IanMcL
  • 366
  • 2
  • 10
3
votes
1 answer

EasyAdmin 4 Image Field preserve value on edit

I am building simple admin panel using Easy Admin 4 and Symfony 6. Can't figure out how to preserve uploaded image value when editing entity. Image preview is not visible on Edit form also. Code is very simple: public function…
Bogdan Kuštan
  • 5,427
  • 1
  • 21
  • 30
3
votes
1 answer

Doctrine "Entity" is not a valid entity or mapped super class

In my doctrine.php I have the following configuration
vukojevicf
  • 609
  • 1
  • 4
  • 22
3
votes
1 answer

Command "set-info" is not defined when I try tu execute symfony command

I started to wtrite a command, following the doc and this si the command now(very very simple) namespace App\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use…
af_fgh
  • 55
  • 3
1
2 3
28 29