Laravel 5.5 - 从嵌套包加载迁移

时间:2017-10-18 08:25:15

标签: laravel composer-php

我目前正在使用一些Laravel软件包,并对集成嵌套软件包有疑问。

我是Tagging& amp;的套餐。角色并希望将它们集成到另一个博客包中。

但我无法从嵌套(Tagging& Roles)软件包中加载迁移。

我目前正在尝试在BlogServiceProvider(注册函数)中加载包的服务提供者。但是当我尝试进行作曲家更新或转储自动加载

时,总是会出错
$this->app->register(
 'OName\Taggy\TaggyServiceProvider'
);

 $this->app->register(
 'OName\Roles\RolesServiceProvider'
);

Blog包中的Composer.json

 "require": {
    "php": ">=7.0.0",
   "illuminate/database": ">= 5.0",
   "illuminate/support": ">= 5.0",
    "OName/taggy": "^1.0"
},

"require-dev": {
    "orchestra/testbench": "~3.5",
    "phpunit/phpunit": "~6.0"
},

"autoload-dev": {
    "classmap": [

        "tests/TestCase.php"
    ]
},

"extra": {
    "laravel": {
        "providers": [
            "OName\\Blog\\App\\Providers\\BlogServiceProviders"
        ]
    }
}
来自Taggy包的

Composer.json

  "autoload": {
    "psr-4": {
        "OName\\Taggy\\": "src"
    }
},
"require": {
    "php": ">=7.0.0",
   "illuminate/database": ">= 5.0",
   "illuminate/support": ">= 5.0"
},

"require-dev": {
    "orchestra/testbench": "~3.5",
    "phpunit/phpunit": "~6.0"
},

"autoload-dev": {
    "classmap": [

        "tests/TestCase.php",
        "tests/stubs/TopicStub.php",
        "tests/stubs/TagStub.php"
    ]
},

"extra": {
    "laravel": {
        "providers": [
            "OName\\Taggy\\App\\Providers\\TaggyServiceProvider"
        ]
    }
}

错误:

[Symfony\Component\Debug\Exception\FatalThrowableError]  

Class' OName \ Taggy \ TaggyServiceProvider'找不到

有什么建议吗?

先谢谢了。干杯,斯坦

0 个答案:

没有答案