Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unrecognized option "resource" under "fos_user"

I am integrating FOSUserBundle in my application and I am trying to run php bin/console doctrine:migration:diff after following the recommended set-up.

I am systematically getting a:

In ArrayNode.php line 319:

  Unrecognized option "resource" under "fos_user"

Yet, I have 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 my composer.json and ran composer update.

Update

My fos_user.yaml is:

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: App\Entity\Admin\User
    from_email:
        address: [email protected]
        sender_name: xxx
like image 407
Jérôme Verstrynge Avatar asked Jan 25 '18 15:01

Jérôme Verstrynge


3 Answers

Dlondero's suggestion fixed the issue, the fos_user configuration should be set in config/routes.yaml.

From documentation, routes are never automatically added in configuration.

like image 79
Jérôme Verstrynge Avatar answered Oct 28 '22 05:10

Jérôme Verstrynge


move the :

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

into config/routes.yaml insted of confing/packages/routing.yml

like image 38
user9924418 Avatar answered Oct 28 '22 06:10

user9924418


If I am not wrong, config/packages/routing.yaml file is not for routes, it is the config file for routing bundle, you can not put your routing configs to there. Instead, you should put them under config/routes folder, as bundle_name.yml.

Like this, eg. config/routes/imagine.yml:

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.yaml"
like image 5
xurshid29 Avatar answered Oct 28 '22 05:10

xurshid29