2016-10-23 115 views
0
  1. 我已經包括以下 我有添加到composer.json: 「照亮/ HTML」: 「5.0 *」 我有添加到app.php提供商數組: b)'Form'=>'Illuminate \ Html \ Html \ HtmlFacade', 'Illuminate \ Html \ HtmlServiceProvider', 我已經添加到app.php別名數組中: a)'Html'=>'Illuminate \ Html \ FormFacade',類HTML未找到laravel 5.0

    當我嘗試更新我的作曲家在cmd我得到以下錯誤可能是什麼問題

    C:\xampp>cd\xampp\htdocs\sites\project\laravel\mysitegud 
    
    C:\xampp\htdocs\sites\project\laravel\mysitegud>composer update 
    
    
        [Seld\JsonLint\ParsingException] 
        "./composer.json" does not contain valid JSON 
        Parse error on line 8: 
        ...amework": "5.0.*"   "illuminate/html", " 
        ---------------------^ 
        Expected one of: 'EOF', '}', ':', ',', ']' 
    

下面的下面的代碼是composer.json

{ 
    "name": "laravel/laravel", 
    "description": "The Laravel Framework.", 
    "keywords": ["framework", "laravel"], 
    "license": "MIT", 
    "type": "project", 
    "require": { 
     "laravel/framework": "5.0.*" 
     "illuminate/html", "5.0.*" <!--this code is for illuminate--> 

    }, //is there any problem in the following code.i have noticed that laravel is key sensitive .may be i went wrong some where but i dont know where. 

回答

0

require陣列的第二項將被誤格式化。鍵和值之間的分隔符/分離器是:使用JSON,而不是一個簡單的,

電流線

"illuminate/html", "5.0.*" 

正確路線

"illuminate/html": "5.0.*" 

現在運行composer update時或composer install取決於您的項目statu秒。它現在應該正確安裝HTML和Form插件。

而且不要忘了新的形式和HTML的外觀添加到您的aliases

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

和的ServiceProvider

'providers' => [ 
    // ... 
    Collective\Html\HtmlServiceProvider::class, 
    // ... 
    ], 

如果要升級到L5,您應該刪除舊的聲明。

現在運行composer dumpauto,然後是artisan optimize

+0

將行更改爲'「illuminate/html」:「5.0。*」'i另一個錯誤'致命錯誤:類'Illuminate \ Foundation \ Application'未在C:\ xampp \中找到後,更改爲 – harri

+0

。 htdocs \ sites \ project \ laravel \ mysitegud \ bootstrap \ app.php on line 14' – harri

+0

將行更改爲「illuminate/html」:「5.0。*」'i another error致命錯誤:Class'Illuminate \ Foundation \ Application '在第14行找不到C:\ xampp \ htdocs \ sites \ project \ laravel \ mysitegud \ bootstrap \ ap p.php – harri