symfony5

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

时光总嘲笑我的痴心妄想 提交于 2020-03-09 05:41:07
问题 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) * @ORM\Entity(repositoryClass="App\Repository\EventRepository") */ class Event { /** * @ORM\Column(type="datetime") * @Assert\DateTime * @Assert\NotNull */ private $createdAt; public function __construct() { $this->createdAt = new \DateTime(); } public function

How to implement multiple authentication in Symfony?

送分小仙女□ 提交于 2020-02-08 11:09:05
问题 I am following following tutorial about Backend API AUthentication using JWT. https://rojas.io/building-a-jwt-authenticator-in-symfony-4/ I have two authentication in my API. LoginAuthenticator JwtAuthenticator. Below is my security.yaml file. security: encoders: App\Entity\User: algorithm: auto providers: app_user_provider: entity: class: App\Entity\User property: email firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: anonymous: true guard: authenticators: -

How to implement multiple authentication in Symfony?

泪湿孤枕 提交于 2020-02-08 11:08:05
问题 I am following following tutorial about Backend API AUthentication using JWT. https://rojas.io/building-a-jwt-authenticator-in-symfony-4/ I have two authentication in my API. LoginAuthenticator JwtAuthenticator. Below is my security.yaml file. security: encoders: App\Entity\User: algorithm: auto providers: app_user_provider: entity: class: App\Entity\User property: email firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: anonymous: true guard: authenticators: -

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

女生的网名这么多〃 提交于 2020-01-22 00:05:08
问题 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 server:run Command "server:run" is not defined. Do you want to run "server:dump" instead? (yes/no) [no]: So how to downgrade or start the local server? 回答1: For running a local web server you can now use Symfony Client, or simply 'Symfony'. Download the

Symfony 5 Installation on Windows 10 keeps running old version

本小妞迷上赌 提交于 2020-01-17 23:55:44
问题 I downloaded and ran "setup.exe" from https://symfony.com/download. Installation seemed to run well. Calling symfony --version results in Symfony Installer version 1.5.11 There might be installed an old Symfony version on the system - however I cant find any hint on where it actualy runs the old exectuable from (nothing obvious in System Path). Also - shouldn't this installer just update the symfony version running? If I download the current symfony exectuable "symfony_windows_amd64.exe" from