在Laravel“helper”目录的composer转储后权限被拒绝

I have created a directory in my app folder called helpers and created a new file with a helper function.

I ran composer dump which completed successfully.

Now when I try to go to any page in my app I get:

Warning: require(C:\wamp\www\abc\app\helpers): failed to open stream: Permission denied in C:\wamp\www\abc\vendor\composer\autoload_real.php on line 58

I have read a few posts about how to fix this for Linux but I'm using windows 7. All permissions are set correctly so I'm a bit lost.

How can I fix this?

you need to include this folder in composer.json like this

"autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php",
            "app/helpers"
        ]
    },

and then fire composer dump-autoload

I fixed it by specifically naming the file I wanted to use:

"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ],
            "files": [
                "app/helpers/general.php"
            ]
},