当前位置: 首页 > 知识库问答 >
问题:

我做了自动加载来重建我的班级地图

宣熙云
2023-03-14

通过作曲家安装Moltin Cart,然后添加服务提供商:'Moltin\Cart\CartServiceProvider'并添加别名'Cart'=

现在我得到laravel 4错误:

Symfony \ Component \ Debug \ Exception \ FatalErrorException Class 'Moltin\Cart\CartServiceProvider' not found.

我已经完成了自动加载转储来重建我的类映射composer dump autoload,但仍然存在问题。

mycomposer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*",
        "intervention/image": "dev-master",
         "moltin/cart": "dev-master"
    },

    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "dev"

}

我app.php这里

<?php

return array(

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => true,

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'http://localhost',

/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/

'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/

'locale' => 'en',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/

'key' => 'Hb2cd1FUfJV6S0ApZAS9QSAQEFEiusUc',

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/

'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    'Illuminate\Cache\CacheServiceProvider',
    'Illuminate\Session\CommandsServiceProvider',
    'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
    'Illuminate\Routing\ControllerServiceProvider',
    'Illuminate\Cookie\CookieServiceProvider',
    'Illuminate\Database\DatabaseServiceProvider',
    'Illuminate\Encryption\EncryptionServiceProvider',
    'Illuminate\Filesystem\FilesystemServiceProvider',
    'Illuminate\Hashing\HashServiceProvider',
    'Illuminate\Html\HtmlServiceProvider',
    'Illuminate\Log\LogServiceProvider',
    'Illuminate\Mail\MailServiceProvider',
    'Illuminate\Database\MigrationServiceProvider',
    'Illuminate\Pagination\PaginationServiceProvider',
    'Illuminate\Queue\QueueServiceProvider',
    'Illuminate\Redis\RedisServiceProvider',
    'Illuminate\Remote\RemoteServiceProvider',
    'Illuminate\Auth\Reminders\ReminderServiceProvider',
    'Illuminate\Database\SeedServiceProvider',
    'Illuminate\Session\SessionServiceProvider',
    'Illuminate\Translation\TranslationServiceProvider',
    'Illuminate\Validation\ValidationServiceProvider',
    'Illuminate\View\ViewServiceProvider',
    'Illuminate\Workbench\WorkbenchServiceProvider',
     'Intervention\Image\ImageServiceProvider',
      'Moltin\Cart\CartServiceProvider'


),

/*
|--------------------------------------------------------------------------
| Service Provider Manifest
|--------------------------------------------------------------------------
|
| The service provider manifest is used by Laravel to lazy load service
| providers which are not needed for each request, as well to keep a
| list of all of the services. Here, you may set its storage spot.
|
*/

'manifest' => storage_path().'/meta',

/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/

'aliases' => array(

    'App'             => 'Illuminate\Support\Facades\App',
    'Artisan'         => 'Illuminate\Support\Facades\Artisan',
    'Auth'            => 'Illuminate\Support\Facades\Auth',
    'Blade'           => 'Illuminate\Support\Facades\Blade',
    'Cache'           => 'Illuminate\Support\Facades\Cache',
    'ClassLoader'     => 'Illuminate\Support\ClassLoader',
    'Config'          => 'Illuminate\Support\Facades\Config',
    'Controller'      => 'Illuminate\Routing\Controller',
    'Cookie'          => 'Illuminate\Support\Facades\Cookie',
    'Crypt'           => 'Illuminate\Support\Facades\Crypt',
    'DB'              => 'Illuminate\Support\Facades\DB',
    'Eloquent'        => 'Illuminate\Database\Eloquent\Model',
    'Event'           => 'Illuminate\Support\Facades\Event',
    'File'            => 'Illuminate\Support\Facades\File',
    'Form'            => 'Illuminate\Support\Facades\Form',
    'Hash'            => 'Illuminate\Support\Facades\Hash',
    'HTML'            => 'Illuminate\Support\Facades\HTML',
    'Input'           => 'Illuminate\Support\Facades\Input',
    'Lang'            => 'Illuminate\Support\Facades\Lang',
    'Log'             => 'Illuminate\Support\Facades\Log',
    'Mail'            => 'Illuminate\Support\Facades\Mail',
    'Paginator'       => 'Illuminate\Support\Facades\Paginator',
    'Password'        => 'Illuminate\Support\Facades\Password',
    'Queue'           => 'Illuminate\Support\Facades\Queue',
    'Redirect'        => 'Illuminate\Support\Facades\Redirect',
    'Redis'           => 'Illuminate\Support\Facades\Redis',
    'Request'         => 'Illuminate\Support\Facades\Request',
    'Response'        => 'Illuminate\Support\Facades\Response',
    'Route'           => 'Illuminate\Support\Facades\Route',
    'Schema'          => 'Illuminate\Support\Facades\Schema',
    'Seeder'          => 'Illuminate\Database\Seeder',
    'Session'         => 'Illuminate\Support\Facades\Session',
    'SSH'             => 'Illuminate\Support\Facades\SSH',
    'Str'             => 'Illuminate\Support\Str',
    'URL'             => 'Illuminate\Support\Facades\URL',
    'Validator'       => 'Illuminate\Support\Facades\Validator',
    'View'            => 'Illuminate\Support\Facades\View',
     'Image'           => 'Intervention\Image\Facades\Image',
      'Cart'            => 'Moltin\Cart\Facade'
),

);


共有1个答案

申屠泉
2023-03-14

您需要的包不包含类Moltin\Cart\FacadeMoltin\Cart\CartServiceProvider。这是因为包“moltin/cart”是一个通用包,不提供任何与Laravel集成的功能。

您正在寻找的软件包名为"moltin/laravel-car"。

然而,我建议不要使用它。测试的主分支的"moltin/车"目前是失败的,并没有正式的,标记释放。moltin/laravel-car版本笨拙(似乎他们将自己的版本与Laravel的目标版本之一同步),但是他们没有注意到Laravel明确不遵循语义版本控制,所以需要~5.0作为moltin/laravel-car将要么安装一些5.0或5.1版本,这将是不兼容的。

 类似资料:
  • 问题背景: 生成一个java文件,其中包含一个不存在的超类的类;让javac解析类,但不编译它;通过编程生成超级类(这意味着没有类文件);最后让javac成功地生成一个类文件。 这里是CompilerAPITest.java 我目前的挑战 我已经通过编程生成了一个类文件(GeneratedClass)。我希望java编译器能够使用它来编译Helloworld。JAVA我尝试过上述方法,但Hello

  • 问题内容: 我正在练习 自我连接 ,这是我编写查询时不了解的事情。 我有桌子 雇员表包含三个记录。 最后一列manager_id是指使Ahmed和Tove成为Ola经理的第一列ID。 如果我这样写查询 结果使艾哈迈德和托夫经理。然而 正确无误,有人可以解释吗? 问题答案: 自联接就像内部联接,其中同一表的两个或更多实例通过公共数据类型的列/字段联接在一起。这种连接(内部连接)根据连接条件给出公共行

  • 我有一个库,它是一个商业产品的直接扩展。那个产品已经有几年的历史了,并且使用Sun的JAXB-2.0库。 我的库使用JAXB,我遇到了一个非常奇怪的错误。什么可能导致“JAXBElement没有no-arg默认构造函数”? 我发现这是由旧库中的错误引起的。我是否可以抢占已加载的类以强制我的扩展使用该类的“正确”版本? 编辑:和我的插件一起,我打包了JAXB-2.2.5(在我的插件的类路径中引用了它

  • 问题内容: 诸位令人惊奇。在过去的两天里,我已经在这里发布了两次-一个新用户- 我对帮助感到震惊。因此,我认为我会采用软件中最慢的查询,看看是否有人可以帮助我加快查询速度。我使用此查询作为视图,因此务必要快(不是!),这一点很重要。 首先,我有一个联系人表,用于存储我公司的客户。该表中有一个JobTitle列,其中包含一个在Contacts_Def_JobFunctions表中定义的ID。还有一个

  • 问题内容: 我正在使用Java版本的Google App Engine。 我想创建一个可以接收许多类型的对象作为参数的函数。我想打印出对象的成员变量。每个对象可能不同,并且该功能必须适用于所有对象。我必须使用反射吗?如果是这样,我需要编写哪种代码? 我将如何编写函数getObject? 问题答案: 是的,您确实需要反思。它会像这样: 有关更多信息,请参见反射教程。