Accessing package controllers in Laravel 4

前端 未结 3 2030
滥情空心
滥情空心 2020-12-15 10:48

I have created a package following the \"Creating a Package\" instructions in the Laravel 4 documentation. After creating the package I have created a \"controllers\" folder

3条回答
  •  悲&欢浪女
    2020-12-15 10:58

    You may try edit your Vendor/Package/composer.json and insert the controllers dir to autoload/classmap:

    ....
    "autoload": {
        "classmap": [
            "src/migrations",
            "src/controllers",
            "src/models"
        ],
        "psr-0": {
            "Package\\Controller": "src/"
        }
    }
    ....
    

    After that, open your terminal and from your package root dir do a composer dump-autoload

    Works for me...

提交回复
热议问题