Category "symfony"

Twig: Unexpected token "name" of value "as" ("end of statement block" expected)

When i run a Twig Lint test localy using CLI on a file, i get no warning. But, my Gitlab pipeline returns a KO for the same file at the Twig-Lint stage: Unexpe

Inserting the current date doctrine

I have created a symfony project and am having a date issue. I would like to make a request which inserts the current date in the database. In my entity my fiel

Is it possible to change the way EasyAdmin load entities in index?

in my project with Symfony (PHP), i use EasyAdminBundle and i'm wondering if it's possible to change the way easyadmin load entities with pagination? I would li

When to use action injection and when to inject dependencies on the constructor for controllers?

In Symfony you can direct inject a service into a controller function: use App\Service\FooService; class FooController { public function one(FooService $fo

"Unable to find template" with Docker

I created a Symfony environment with Docker. I then included this file in my web project (skeleton website). But when I try to access my base.html.twig page loc

Symfony6 FindBy and entity many to many

I use symfony6 for the first time with php 8.0.17. I want to make a small form that allows me to retrieve "Card" objects. My "Card" objects are bound to many to

Database updates not readable while PHPunit WebTestCase (Symfony 5.1)

I have a problem asserting updates made by a form are really written in the database. I explain, I first do a create test (testCreateLactationForm), very simila

Unable to find "Proxies\__CG__\App\MyBundle\Entity\User" entity identifier associated with the UnitOfWork

I updated a Symfony project from version 3.4 to 5.3, and after that, I am getting the following error on some pages: Unable to find "Proxies\__CG__\App\MyBundle

Couldn't find constant subresourceOperations, class App\Entity\Comment

i have two table comment and author between them OneToMany relation, i want to display author of comment but it gives me error [Semantical Error] Couldn't find

401 Invalid JWT Token Lexik

I'm not sure why i Keep getting a wrong bearer token. { "code": 401, "message": "Invalid JWT Token" } When i debug it on https://jwt.io/ i also get a Invalid S

How can I prevent autologout of user in Symfony 4?

When the user uses my symfony application, then after a couple of minutes the user is automatically logged out, while he is working with the application. To pre

Deploy API Platform 2.6 and Symfony 5.4

I created a project with Api platform 2.6 & Symfony 5.4 and then I uploaded it with FileZilla (FTP). I followed the step to deploy a Symfonyproject update c

EasyAdmin: Error on change formTypeOptions property field in twig

I've an User entity and EasyAdmin (EA) UserCrudController for manage to them. The User entity has active boolean field. And I want that field will be disabled f

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

How to add all page specific entries from dependency

I'm currently upgrading an existing app with legacy per-page frontend javascript and CSS to Symfony's Webpack Encore. The app and it's dependencies each supply

Try to use Symfony mailer with Gmail

Try to use Symfony mailer with Gmail on my Symfony 5.1 app. mailer.yaml: framework: mailer: dsn: '%env(MAILER_DSN)%' .env: MAILER_DSN=gmail+smtp://

disable transport fallback when sending emails

I have two transports, one for general emails and the other for noreply emails because of huge number mailer.yml: framework: mailer: transports:

getUser method from Symfony Security can't get my User Repository

My problem is the $this->getUser(); method (called from Controller) from Symfony Security can't get my User Repository. The "App\Model\ODM\Repository\UserRep

Symfony 4.4 Translation Annotations Nelmio ApiDoc

I have a symfony 4.4 project with enabled translations and now I have to find a solution that translations also take effect for swagger annotations. The result