Questions tagged [symfony5]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 5. 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 5 was released in November 2019 and includes several changes compared to its predecessor. However there are no new features compared to version 4.4.

1079 questions
28
votes
1 answer

Why do I receive "This value should be of type string" when using a DateTime constraint on Symfony 5?

I have the following entity (only attached the relevant parts): use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ApiResource(mercure=true) *…
Toma
  • 2,764
  • 4
  • 25
  • 44
25
votes
7 answers

symfony 4 : How to get "/public" from RootDir

I have an image under the public folder. How can I get my image directory in symfony4 ? In symfony 3, it's equivalent is : $webPath = $this->get('kernel')->getRootDir() . '/../web/';
Mouna Ben Hmida
  • 345
  • 1
  • 7
  • 17
19
votes
2 answers

Codeception4: GroupManager reports missing test file

I upgraded Codeception to v4 (according to THIS) and then Symfony to v5 (according to THIS). Now, when I try to run tests I get an error about missing test file: root@blabla: vendor/bin/codecept run In GroupManager.php line 129: GroupManager: File…
callmebob
  • 6,128
  • 5
  • 29
  • 46
17
votes
6 answers

How to use Vich uploader with easyAdmin 3 on Symfony 5

I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are…
Chedi Athmni
  • 213
  • 1
  • 2
  • 7
16
votes
4 answers

Symfony 5.1 Deprecation RouteCollectionBuilder -> RoutingConfigurator

I am updating a Symfony project from 5.0 to 5.1 There is this one deprecation hint saying RouteCollectionBuilder is deprecated and RoutingConfigurator should be used instead. The exact message is Since symfony/routing 5.1: The …
user3440145
  • 793
  • 10
  • 34
15
votes
4 answers

New alternative for getDoctrine() in Symfony 5.4 and up

As my IDE points out, the AbstractController::getDoctrine() method is now deprecated. I haven't found any reference for this deprecation neither in the official documentation nor in the Github changelog. What is the new alternative or workaround for…
S. Dre
  • 647
  • 1
  • 4
  • 18
15
votes
6 answers

How to start local server with symfony 5 or downgrade version to 4.4?

I started a new project in new Symfony 5 and i can't open my local server. On Symfony 4.4 the command PHP bin/console server:run is OK, But with Symfony 5 the command appears not to be defined... C:\Users\Chris\Code\api-test> php bin/console…
Fradé
  • 195
  • 1
  • 2
  • 9
14
votes
5 answers

How to manually authenticate user after Registration with the new Symfony 5 Authenticator?

Symfony 5 has changed its guard authentication method to a new Passport based one, using the new security config: enable_authenticator_manager: true; I would like to know how to authenticate a user in the Registration form method in my controller,…
Rodolfo Rangel
  • 596
  • 1
  • 3
  • 15
12
votes
11 answers

Symfony 5 & EasyAdmin 3.0 - /admin route not found

I have fresh Symfony 5 project instlled locally, and added Easy Admin trought Symfony CLI: symfony composer req admin I should have /admin route but it's missing I run: symfony console cache:clear symfony composer dump-autoload rm -rf…
platkos
  • 155
  • 1
  • 1
  • 7
11
votes
3 answers

Symfony 5 ApiKeyAuthenticator with SelfValidatingPassport

I am working on a new Symfony 5.3.6 project and want to implement authentication, based on the new system as stated in: https://symfony.com/doc/current/security/authenticator_manager.html#creating-a-custom-authenticator I do not have any users and…
connectedMind
  • 421
  • 4
  • 17
11
votes
3 answers

TooManyRequestsException with Amazon Product Advertising API

I'm starting to develop a simple Symfony 5 application. It uses Amazon Product Advertising API 5.0 with the paapi5-php-sdk package (provided by TheWirecutter, since Amazon pulled it from Packagist, but this is irrelevant). I've a 5 years old…
10
votes
2 answers

Api platform handling fille uploads

I'm trying to upload files with Api Platform and Vich Uploader Bundle. When I send POST request with multipart/form-data and Id of the entity to attach image file to, I get 200 response with my entity. But uploaded file doesn't uploads to…
Andrey Kryukov
  • 765
  • 1
  • 10
  • 23
9
votes
1 answer

symfony/profiler-pack is being removed right after installation

I have created a project using command composer create-project symfony/website-skeleton my_project_name I want to install symfony/profiler-pack. Why? Because of that there is no "Debug" tab in the profiler. I have tried using composer require --dev…
Tarasovych
  • 2,228
  • 3
  • 19
  • 51
7
votes
2 answers

Symfony 5.3 - why is my remember me functionality not working?

I am just upgrading my symfony 4.4 application to 5.3 to use some new cool stuff (UX, UUID, ..). So I started a new project and ran the make:auth command to create the security components at latest defaults. Everything works perfect, except the…
fehmelchen
  • 203
  • 3
  • 15
7
votes
1 answer

How should one get Session object in a controller on Symfony 5.3?

I'm a little confused as to the "right" way to retrieve the current session object within a controller in Symfony 5.3. The current documentation says to typehint an argument as SessionInterface. However, this Symfony blog post says SessionInterface…
patrick3853
  • 1,100
  • 9
  • 17
1
2 3
71 72