Laravel 5.1在Container.php第737行中给出了ReflectionException

时间:2015-10-06 15:20:03

标签: php laravel laravel-5

我正在添加html帮助器并面对这个波纹管问题。我找不到解决方案。

添加composer.json

"illuminate/html": "5.*"

并运行composer update

打开您的config / app.php

在“提供商”下添加

Illuminate\Html\HtmlServiceProvider::class,

添加'别名'

'Form'      => Illuminate\Html\FormFacade::class,
'Html'      => Illuminate\Html\HtmlFacade::class,

此处控制器文件

    namespace App\Http\Controllers;

    use Illuminate\Http\Request;
    use App\Http\Requests;
    use App\Http\Controllers\Controller;

    class AdminAuthController extends Controller
    {
        public function index()
        {
            return view('admin-pages.login');
        }

        public function home()
        {
            return view('admin-pages.home');
        }
    }

这里有Composer.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "illuminate/html": "5.*",
    "laravelcollective/html": "^5.1"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
}
}

我附加输出文件enter image description here

感谢。

2 个答案:

答案 0 :(得分:0)

你可以选择路线档吗?我猜那个问题就在那里......或者尝试用外墙使用View;并且这样称呼:

return View::make('admin-pages.login');

答案 1 :(得分:0)

我按照以下两个步骤解决了同样的问题:

  1. put" league / oauth2-server":" 4.1。*"在composer.json文件的require部分。
  2. run'作曲家更新'命令终端。
  3. 您也可以尝试。