I’m working on an API, and I had implemented a JWT to make it stateless. I created an AuthController, which returns a JWT when login information is correct. Here you can see the return code that generates the token: This is the result when I run the authenticate method, un the URL localhost:8000/authenticate. Now, what I would need to do
Tag: symfony
Symfony Cron library failed on Doctrine DBAL error
I am using this cron library within my Symfony project. It was working today and after recreating everything from the start (docker, database, vendor folder) and running it again, it crashes. As it says in documentation I was able to make specific commands and they are persisted in the database. However when running bin/console cron:start –blocking it throws: In Manager.php
How to get form data with session in Symfony Form
I’ve been looking for a solution for hours. I’am working with Symfony 3.2. I’am using Symfony Forms in order to display a data-table (with different filter chosen in the form) with Ajax => No submit button. I can access to different result of data-table to view more information. What i want is that when i leave the detail page by
Symfony Messenger: is it possible to not throw the exception on last retry?
We’re using Symfony Messenger, and have these transports: When we send a message to the async queue, and the last retry fails with an exception, the exception is logged to the MessengerMessages table, and the exception bubbles up (goes to Sentry in our case). This is what we want. When we send a message to the asyncLowPriority queue however, we
Multiple subdirectories for controllers in annotations.yaml
I’m am trying to organize my controllers a bit more in a Symfony 5.3 application. They are in a couple of subdirectories and use annotations for their routing. Here are some samples: ../src/StuffA/Controller/ControllerA.php ../src/StuffB/Controller/ControllerB.php I now want to specify both inside my annotations.yaml. I tried several approaches, but could not find anything that works: Wildcards – Does not work Multiple
How to automatically trim string when persisting a Doctrine entity?
Let’s say I have this entity: My controller: I want doctrine to register the name of myEntity as awesome name and not awesome name . Is there a way to configure doctrine to do this? Answer You do not need to “configure doctrine” in any way. Just use PHP and introduce the logic in your entity: This way your data
Symfony Registering New User getUser returns null on handling request
Trying to register a new user with a form and ajax request (as it will become a modal form) and hit a snag on trying to validate the form. When the request gets handled, it states that the user is null in the password validator. And not understand how to get past this or allow this one route to allow
Symfony 5 using the validation to validate a new entity
I’m using Symfony 5.3.7, and using the @Assert annotations, attempting to validate a new user upon registering. Trying to understand the docs however not getting anywhere. Ideally I’d like to be able to understand how to validate an entity using these annotations. I’ve tried using a separate class, and got nowhere with understanding, although I do want to go down
Symfony 3.4 – cannot load field value
I’m using Symfony 3.4.47 w/ MySQL 8 and getting a field value wasn’t a big thing until today. I’ve created a migration file to add a new field to an existing entity: And I’ve added the field ‘cliente_apelido’, getter and setter to the ‘Plano.php’ model: It turns that, when I’m trying to use the getClienteapelido() getter, it returns an empty
FOS Elastica bundle populate command killed by oom_reaper with out of memory
There are 1,8 million records in the database table that I want to index through the fos:elastica:populate command. As soon as ~500.000 documents are already in the elasticsearch the indexing stops abruptly. In the dmesg on backend server I saw this: Elasticsearch, MySQL and PHP Symfony backend (where populate runs) are on different servers. How can I fix that and