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

How to enable Symfony Profiler toolbar only for local environment?

I'm new to using Symfony so not quite sure how to go about doing this. I'm using a local environment to develop a Symfony site. We have production and development sites set up as cloud environments. I'd like to enable the Symfony Profiler toolbar…
kait
  • 305
  • 2
  • 3
  • 11
-1
votes
1 answer

Symfony 5 error after install FOS REST bundle

I'm working on implement API Services in Symfony 5. I installed friendsofsymfony via composer. Now I receive this message: "Argument 1 passed to Doctrine\ORM\Mapping\Index::__construct() must be of the type array or null, string given, called in…
jluishg
  • 1
  • 1
-1
votes
1 answer

Symfony 5: Wire manually Controller method arguments

I am trying to mock a service in order to test one of my controller's method: class ExampleController extends AbstractController { /** * @Route("/example", name="app_example", methods={"POST"}) */ public function…
MaxPower
  • 45
  • 1
  • 12
-1
votes
1 answer

How to define default Entity Manager for Symfony Entities

I am setting up an App with multiple databases, each database has its own entity manager. When I query the data and specify the entity manager for the entity, it works fine. I cannot create a form that has a relationship (both entities use the same…
Patrick
  • 3,142
  • 4
  • 31
  • 46
-1
votes
1 answer

Symfony 5 Issue with mailing

I ran into an issue while creating my registration form in Symfony 5. Those are the commands I used to be able to build it. composer create-project symfony/website-skeleton my_project_name symfony console make:controller HomeController composer…
-1
votes
1 answer

Symfony 5 / Doctrine: Sorting entity collection by creation DateTime

I am developing a project using Symfony 5. One of my use-cases involves reading a collection from the Database, with the items sorted by creation order, descending (newest first). I am using the "Timestampable" extension from…
MaxPower
  • 45
  • 1
  • 12
-1
votes
1 answer

Symfony autowire/autoconfigure not working

I created a symfony 5.3 api. My plan is to inject the "EntityManager" via "EntityManagerInterface". Error that comes: Could not resolve argument $entityManager of "app\controller\createuseraccountcontroller()", maybe you forgot to register the…
Cray
  • 27
  • 1
  • 4
-1
votes
1 answer

Why is this cookie not preserved across requests?

I want to add a cookie with a value once the user was logged in Symfony, a cookie that was saved during all requests for the current session and check if that cookie exists in nginx, if so the file will be shown. The cookie was created and sent but…
Kevin Gravell
  • 499
  • 2
  • 7
  • 20
-1
votes
1 answer

how can I define "remember me" for each one separately? Symfony 5

I create two auth "admin" and "user" in Symfony 5 ( security section ) I set them in main firewall. Now how can I define "remember me" for each one separately?? For admin: remember_me: secret: '%kernel.secret%' lifetime: 86400 For…
BTS
  • 1
-1
votes
1 answer

liip imagine_filter in Symfony Controller on non public path

Is there any way to use liip imagine_filter without copying the image source to a public path? I can not see how resolvers/loaders have to be set up to load images from a non public file location and store them likewise. I defined a watermark filter…
-1
votes
1 answer

Symfony redirect to referring page after registration

In my Symfony 5 project, I have a payment page restricted to members only. /** * @Route("/membership_payment/{id}", name="membership_payment") * @IsGranted("ROLE_MEMBER") */ If not signed in, this presents users with the choice to login or…
Pandy Legend
  • 1,102
  • 3
  • 15
  • 29
-1
votes
1 answer

Symfony - Ask user's password to access a route

How to implement a before filter that asks to confirm a user password to access some routes? I'd see this when using Laravel (password.confirm middleware) but I could find similar for Symfony. Thank you.
-1
votes
1 answer

How to use multiple User Provider in Symfony 5

Now my web is used this provider and its working. But i need api token authentication. i need more user provider. security: providers: SecurityUserProvider: id: App\Security\SecurityUserProvider
-1
votes
1 answer

It is possbile to update Symfony 5 from 4.21.6 on Windows 7?

do you know if it's possible from the command ? It's like windows 7 can't download so I want to find a way to have symfony 5, Am I able to work on a project Symfony 5 with my friends ?
-1
votes
1 answer

Why are Symfony roles stored as "json" doctrine type?

Since we will just be storing short simple strings here, why is it presented as the default option when we could be using a simpler simple_array? Is it just a matter of preferences?
yhu420
  • 436
  • 6
  • 18