Laravel 5.1:类html不存在 [英] Laravel 5.1: Class html does not exist

查看:248
本文介绍了Laravel 5.1:类html不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从4.2直接升级到5.1,遇到Html和Form类的问题。

I am upgrading from 4.2 directly to 5.1 and run into problems with the Html and Form classes.

我遵循升级说明,并执行

I followed the upgrade notes, and did


  • 添加laravelcollective / html:〜5.0到composer.json

  • 作曲家更新

  • 将Collective\Html\HtmlServiceProvider ::类添加到app.php中的提供者

  • 添加Form'=> Collective\Html\FormFacade :: class,
    Html'=> Collective\Html\HtmlFacade :: class到app.php中的别名

  • add "laravelcollective/html": "~5.0" to composer.json
  • composer update
  • add Collective\Html\HtmlServiceProvider::class to providers in app.php
  • add Form' => Collective\Html\FormFacade::class, Html' => Collective\Html\HtmlFacade::class to aliases in app.php

但是我的观点不工作当使用HTML ::路由器或获取时,我得到类HTML不存在当使用link_to_route时,类html不存在

But my views don't work. I get either Class HTML does not exist when using HTML::router or get Class html does not exist when using link_to_route

我还尝试了 Illuminate\html 而不是 laravelcollective ,我做了一个 composer dump-autoload

I also tried Illuminate\html instead of laravelcollective, I did a composer dump-autoload.

完整的错误:

ErrorException in Container.php line 736: Class html does not exist (View: C:\Dev\www\admin\resources\views\clubs\index.blade.php)
ReflectionException in Container.php line 736: Class html does not exist

我缺少什么?

我尝试过所有人的答案,没有人为我出于某种原因最终我创建了一个全新的Laravel应用程序,复制了我的代码,然后开始工作,所以尽管解决了实际问题仍然是一个谜。

推荐答案

我的问题解决了,但实际原因仍然未知。我创建了一个全新的Laravel安装,并复制了我的来源(所有这一切)。新应用程序立即工作(安装照明/ html后)。

My problem is solved, but the actual cause is still unknown. I have created a completely new laravel install and copied my source (all of it). The new application worked right away (after installing illuminate/html).

所以你以为我做错了套餐?这就是我的想法,然后我在两个目录上做了一个差异,只是发现它们是相同的。所以这是一个真正的奥秘。

So you think I did something wrong with packages? That's what I thought, and then I did a diff on the two directories, only to find out they were identical. So it's a real mystery.

所以现在一切正常,我只是重命名了我的新应用程序,可以继续。

So, now everything is working, I simply renamed my new application and can continue.

我知道在某些时候,我可能已经安装了HTML包的集合和照明版本。这是最可能损坏的一切。

I do know at some point I probably had both the collective and the illuminate versions of the HTML package installed. That's what most likely corrupted everything.

这篇关于Laravel 5.1:类html不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆