莫菲    

laravel5.2 class 'form' not found ,class 'Input' not found

8年前发布  · 1566 次阅读
  laravel5 

一.解决class‘form’ not found 的方法

  1. 在项目 composer.json 文件中的 require中添加代码:
"require": {
//...
    "laravel/framework": "5.2.*",
"laravelcollective/html": "^5.2",
//...
}

2.进入项目根目录更新composer 

composer update

3. 在config/app.php 中添加对应的 providers:

'providers' => [   
//...   
  /*
         * Forms & HTML 组件 - laravelcollective/html
         */
        Collective\Html\HtmlServiceProvider::class,
        Maatwebsite\Excel\ExcelServiceProvider::class,
//...   
],

4. 在config/app.php 中添加 对应的 aliases:

'aliases' => [
// ...
  'Form'      => Collective\Html\FormFacade::class,
   'Html'      => Collective\Html\HtmlFacade::class,
// ...
],

 

二. 解决class 'Input' not found 的方法

在config/app.php 中添加 对应的 aliases:

'aliases' => [
//...
'Input'     => Illuminate\Support\Facades\Input::class,
//...
],