Unrecognized option "resource" in the "fos_user" section

I am integrating FOSUserBundle in my application and I am trying to start php bin/console doctrine:migration:diffafter performing the recommended setup.

I systematically get:

In ArrayNode.php line 319:

  Unrecognized option "resource" under "fos_user"

However, I set the following in my config/packages/routing.yaml:

framework:
    router:
        strict_requirements: ~

fos_user:
    resource: "@FOSUserBundle/Resources/config/routing/all.xml"

What am I doing wrong? I have "friendsofsymfony/user-bundle": "~2.0"in mine composer.jsonand ran composer update.

Update

My fos_user.yaml:

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: App\Entity\Admin\User
    from_email:
        address: no_reply@xxx.com
        sender_name: xxx
+13
source share
4 answers

Dlondero's suggestion fixed the problem, the configuration fos_usershould be installed in config/routes.yaml.

From the documentation, routes are never automatically added to the configuration.

+15
source

, config/packages/routing.yaml , , . config/routes, bundle_name.yml.

, . config/routes/imagine.yml:

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.yaml"
+5

move:

fos_user:
    resource: "@FOSUserBundle/Resources/config/routing/all.xml" 

in config/routes.yamlis inconfing/packages/routing.yml

+5
source

In my case with Symfony 4.3.2 skeleton

fos_user:
    resource: "@FOSUserBundle/Resources/config/routing/all.xml" 

must be inserted into

config/routes/annotations.yaml

and

php bin/console debug:router

displays all fos_user routes

0
source

Source: https://habr.com/ru/post/1692719/


All Articles