2015-05-11 141 views
1

我試圖從laravel 4升級到5,並且一直遵循官方的laravel升級指南。我也遇到了以下錯誤:升級到Laravel 5反射錯誤

ReflectionException在Container.php行776: 類HomeController中不存在

in Container.php line 776 
at ReflectionClass->__construct('HomeController') in Container.php line 776 
at Container->build('HomeController', array()) in Container.php line 656 
at Container->make('HomeController', array()) in Application.php line 644 
at Application->make('HomeController') in ControllerDispatcher.php line 83 
at ControllerDispatcher->makeController('HomeController') in ControllerDispatcher.php line 54 
at ControllerDispatcher->dispatch(object(Route), object(Request), 'HomeController', 'users') in Route.php line 204 
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134 
at Route->run(object(Request)) in Router.php line 701 
at Router->Illuminate\Routing\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101 
at Pipeline->then(object(Closure)) in Router.php line 703 
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 670 
at Router->dispatchToRoute(object(Request)) in Router.php line 628 
at Router->dispatch(object(Request)) in Kernel.php line 214 
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43 
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17 
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55 
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61 
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36 
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40 
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42 
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101 
at Pipeline->then(object(Closure)) in Kernel.php line 115 
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84 
at Kernel->handle(object(Request)) in index.php line 53 

以我的理解,這是因爲我依靠現在depricated HTML服務提供商我已經包含了這些在我的項目按:

composer 


{ 
    "name": "laravel/laravel", 
    "description": "The Laravel Framework.", 
    "keywords": ["framework", "laravel"], 
    "license": "MIT", 
    "type": "project", 
    "require": { 
     "laravel/framework": "5.0.*", 
     "aws/aws-sdk-php": "2.*", 
     "chumper/datatable": "dev-develop", 
     "laravelcollective/html": "~5.0" 
    }, 
    "require-dev": { 
     "phpunit/phpunit": "~4.0", 
     "phpspec/phpspec": "~2.1" 
    }, 
    "autoload": { 
     "classmap": [ 
      "database" 
     ], 
     "psr-4": { 
      "App\\": "app/" 
     } 
    }, 
    "autoload-dev": { 
     "classmap": [ 
      "tests/TestCase.php", 
      "app/Http/Controllers" , 
      "app/Models" 
     ] 
    }, 
    "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 -r \"copy('.env.example', '.env');\"", 
      "php artisan key:generate" 
     ] 
    }, 
    "config": { 
     "preferred-install": "dist" 
    } 
} 

和應用

'providers' => [ 

     /* 
     * Laravel Framework Service Providers... 
     */ 
     'Illuminate\Foundation\Providers\ArtisanServiceProvider', 
     'Illuminate\Auth\AuthServiceProvider', 
     'Illuminate\Bus\BusServiceProvider', 
     'Illuminate\Cache\CacheServiceProvider', 
     'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 
     'Illuminate\Routing\ControllerServiceProvider', 
     'Illuminate\Cookie\CookieServiceProvider', 
     'Illuminate\Database\DatabaseServiceProvider', 
     'Illuminate\Encryption\EncryptionServiceProvider', 
     'Illuminate\Filesystem\FilesystemServiceProvider', 
     'Illuminate\Foundation\Providers\FoundationServiceProvider', 
     'Illuminate\Hashing\HashServiceProvider', 
     'Illuminate\Mail\MailServiceProvider', 
     'Illuminate\Pagination\PaginationServiceProvider', 
     'Illuminate\Pipeline\PipelineServiceProvider', 
     'Illuminate\Queue\QueueServiceProvider', 
     'Illuminate\Redis\RedisServiceProvider', 
     'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 
     'Illuminate\Session\SessionServiceProvider', 
     'Illuminate\Translation\TranslationServiceProvider', 
     'Illuminate\Validation\ValidationServiceProvider', 
     'Illuminate\View\ViewServiceProvider', 
     'Chumper\Datatable\DatatableServiceProvider', 
     'Collective\Html\HtmlServiceProvider', 

     /* 
     * Application Service Providers... 
     */ 
     'App\Providers\AppServiceProvider', 
     'App\Providers\BusServiceProvider', 
     'App\Providers\ConfigServiceProvider', 
     'App\Providers\EventServiceProvider', 
     'App\Providers\RouteServiceProvider', 

    ], 

    /* 
    |-------------------------------------------------------------------------- 
    | 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' => [ 

     'App'  => 'Illuminate\Support\Facades\App', 
     'Artisan' => 'Illuminate\Support\Facades\Artisan', 
     'Auth'  => 'Illuminate\Support\Facades\Auth', 
     'Blade'  => 'Illuminate\Support\Facades\Blade', 
     'Bus'  => 'Illuminate\Support\Facades\Bus', 
     'Cache'  => 'Illuminate\Support\Facades\Cache', 
     'Config' => 'Illuminate\Support\Facades\Config', 
     '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', 
     'Hash'  => 'Illuminate\Support\Facades\Hash', 
     'Input'  => 'Illuminate\Support\Facades\Input', 
     'Inspiring' => 'Illuminate\Foundation\Inspiring', 
     'Lang'  => 'Illuminate\Support\Facades\Lang', 
     'Log'  => 'Illuminate\Support\Facades\Log', 
     'Mail'  => 'Illuminate\Support\Facades\Mail', 
     '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', 
     'Session' => 'Illuminate\Support\Facades\Session', 
     'Storage' => 'Illuminate\Support\Facades\Storage', 
     'URL'  => 'Illuminate\Support\Facades\URL', 
     'Validator' => 'Illuminate\Support\Facades\Validator', 
     'View'  => 'Illuminate\Support\Facades\View', 
     'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade', 
     'Form' => 'Collective\Html\FormFacade', 
     'Html' => 'Collective\Html\HtmlFacade', 

    ], 

]; 

我還是很遺憾我還是遇到了錯誤的任何幫助一如既往不勝感激感謝

+0

你在哪裏存儲控制器在應用程序目錄? – ArjanSchouten

+0

@ Arjan96s控制器存儲在:C:\ xampp \ htdocs \ awsconfig \ app \ Http \ Controllers謝謝 –

+0

@ Arjan96s這是我認爲他們應該去的地方 –

回答

0

有一個在別名部分應該是HTML而不是HTML修正,這將解決在這種情況下該問題的錯字。