请教laravel5 扩展包开发中出现Class 'Demo\Alipay\ServiceProvider' not found的问题

不好意思,重新描述下扩展开发过程中的遇到的问题

我是这样开发扩展的:比如我 github clone https://github.com/overtrue/laravel-wechat.git 放到本地vendor目录,在此基础上开发支付宝支付的laravel5扩展,各种修改后,出现如下错误
FatalErrorException in ProviderRepository.php line 150:
Class 'Demo\Alipay\ServiceProvider' not found

请教下大家:扩展开发的思路有没有问题,如有问题,请帮忙指正,谢谢!
已邀请:

安正超

赞同来自:

提问请明确问题:
  1. Laravel 5 的拓展包文档上有说明写法
  2. 你在开发过程中遇到了什么问题?尝试的解决方案,或者你认为应该的方案但是没成功。

直接扔这种问题没法回答,大家都忙不可能在你都没去尝试自己解决的情况下从头开始教你。

码农

赞同来自:

看文档写的相当清楚 第一步就是
composer require "overtrue/laravel-wechat:dev-master"
你第一步都做不对......

DT27

赞同来自:

遇到同样问题。我也是装了workbench后按教程新建了个空白包,直接错误,找不到class。。。

楼主我找到问题了,手动装的workbench不但要自己添加\config\workbench.php配置文件,文件内容
<?php
return array(
/*
|--------------------------------------------------------------------------
| Workbench Author Name
|--------------------------------------------------------------------------
|
| When you create new packages via the Artisan "workbench" command your
| name is needed to generate the composer.json file for your package.
| You may specify it now so it is used for all of your workbenches.
|
*/
'name' => 'dt27',
/*
|--------------------------------------------------------------------------
| Workbench Author E-Mail Address
|--------------------------------------------------------------------------
|
| Like the option above, your e-mail address is used when generating new
| workbench packages. The e-mail is placed in your composer.json file
| automatically after the package is created by the workbench tool.
|
*/
'email' => 'dragonet1943@gmail.com',
);

还要在\bootstrip\autoload.php中添加
/*
|--------------------------------------------------------------------------
| Register The Workbench Loaders
|--------------------------------------------------------------------------
|
| The Laravel workbench provides a convenient place to develop packages
| when working locally. However we will need to load in the Composer
| auto-load files for the packages so that these can be used here.
|
*/
if (is_dir($workbench = __DIR__.'/../workbench'))
{
Illuminate\Workbench\Starter::start($workbench);
}

li

赞同来自:

ServiceProvider这个类的命名空间加了吗

要回复问题请先登录注册