找不到Laravel服务提供商.为什么


Laravel service provider could not be found. why?

我的服务提供商有问题。

我制作了一个名为库的文件夹。自动加载它。一切都很好。我在这里添加的每个类都可以正常工作。现在,我想做外墙。

我的班级HT()

然后我制作了一个文件,其中包含以下内容:

class HTServiceProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->bind(''Aone'HTML_NS'HT', function()
        {
            return new HT; // Name of your class, be sure to include the namespace     if you are using one.
        });
    }
}

但是当我将其添加到app.php ServiceProviders数组时,它会抛出以下错误:

 Class 'Illuminate'Support'ServiceProvider'HTServiceProvider' not found 

以下是添加到应用程序.php的行:

"Illuminate'Support'ServiceProvider'HTServiceProvider",

我还将命名空间添加到app() bind.

我在这里做错了什么?

可能你只需要为它命名:

$this->app->bind('Your'Namespace'HT', function()