Laravel 4.2 include provider before composer update

I have a custom Laravel module I wrote that i'm including it in my app.php like so:

    'providers' => array(
        'IlluminateFoundationProvidersArtisanServiceProvider',
        'IlluminateAuthAuthServiceProvider',
        'MyCustomProvider'
    );

Everytime I run a composer update its stalls saying that my class in unavailable:

Error Output: PHP Fatal error:  Class MyCustomProvider  not found in ProviderRepository.php on line 157

There must be a way to have my provider in the app config, and still be able to run composer update, otherwise its really difficult to auto-deploy my code?

edit What I find myself doing now is commenting the provider from app.php, running composer update, then re-enabling the provider and everything runs fine.

edit Here is my bootstrap/start.php environments

$env = $app->detectEnvironment(array(
    // Dev environments
    'dev' => array('dev.xxx.com'),

    // Live server catch
    'live'  => array('live.xxx.com'),

    // EU Server catch
    'eu.west.1.live' => array('eu-west-1.xxx.com'),

    // US server catch
    'us.west.1.live' => array('us-west-1.xxx.com'),

    // Local test environments
    'chris' => array('outrunthewolf-MacBook-Air', 'e7180623aa2e', 'precise64'),

    // Local catch
    'dev' => array('*')
));

And my autoload from composer

    "autoload": {
    "classmap": [
        "app/commands",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests"
    ],
    "psr-4": {
        "": "app/controllers/",
        "": "app/libraries/",
        "Model": "app/models/"
    }
},

I would like to suggest some ways to solve this. 1. Please make sure there is no typo in the provider name and that the namespace is correct as suggested by "Quasdunk" in comments. 2. If composer is install on your machine then please execute below command:

composer dump-autoload  

It will auto load your all classes. May be it will helps you.

链接地址: http://www.djcxy.com/p/88642.html

上一篇: 将一个作曲家包加载到Laravel 5中

下一篇: 作曲家更新之前,Laravel 4.2包括提供者