错误类“HTML”未找到 - Laravel 5.4

2024-03-26

我收到以下错误:

未找到“HTML”类(查看: C:\WORK\Software\XamppOne\htdocs\APOSTXUI\ContractorsClubField\resources\views\includes_header.blade.php) (看法: C:\WORK\Software\XamppOne\htdocs\APOSTXUI\ContractorsClubField\resources\views\includes_header.blade.php)

我已经看到了 51.、5.2 和 5.3 的答案 - 但是 - 我没有看到 5.4 的任何内容。

这是我更新时得到的结果:

PS C:\WORK\Software\XamppOne\htdocs\APOSTXUI\ContractorsClubField> composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating laravelcollective/html (v5.4.8 => v5.4): Downloading (100%)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
The compiled services file has been removed.

我做了以下事情:

作曲家.json

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",
    "laravel/tinker": "~1.0",
    "artisaninweb/laravel-soap": "0.3.*",
    "laravelcollective/html": "5.4"
},

然后我跑了作曲家更新

我将以下内容放入 app.php 中

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Application Name
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application. This value is used when the
    | framework needs to place the application's name in a notification or
    | any other location as required by the application or its packages.
    */

    'name' => 'Laravel',

    /*
    |--------------------------------------------------------------------------
    | Application Environment
    |--------------------------------------------------------------------------
    |
    | This value determines the "environment" your application is currently
    | running in. This may determine how you prefer to configure various
    | services your application utilizes. Set this in your ".env" file.
    |
    */

    'env' => env('APP_ENV', 'production'),

    /*
    |--------------------------------------------------------------------------
    | Application Debug Mode
    |--------------------------------------------------------------------------
    |
    | When your application is in debug mode, detailed error messages with
    | stack traces will be shown on every error that occurs within your
    | application. If disabled, a simple generic error page is shown.
    |
    */

    'debug' => env('APP_DEBUG', false),

    /*
    |--------------------------------------------------------------------------
    | Application URL
    |--------------------------------------------------------------------------
    |
    | This URL is used by the console to properly generate URLs when using
    | the Artisan command line tool. You should set this to the root of
    | your application so that it is used when running Artisan tasks.
    |
    */

    'url' => env('APP_URL', 'http://localhost'),

    /*
    |--------------------------------------------------------------------------
    | Application Timezone
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default timezone for your application, which
    | will be used by the PHP date and date-time functions. We have gone
    | ahead and set this to a sensible default for you out of the box.
    |
    */

    'timezone' => 'UTC',

    /*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by the translation service provider. You are free to set this value
    | to any of the locales which will be supported by the application.
    |
    */

    'locale' => 'en',

    /*
    |--------------------------------------------------------------------------
    | Application Fallback Locale
    |--------------------------------------------------------------------------
    |
    | The fallback locale determines the locale to use when the current one
    | is not available. You may change the value to correspond to any of
    | the language folders that are provided through your application.
    |
    */

    'fallback_locale' => 'en',

    /*
    |--------------------------------------------------------------------------
    | Encryption Key
    |--------------------------------------------------------------------------
    |
    | This key is used by the Illuminate encrypter service and should be set
    | to a random, 32 character string, otherwise these encrypted strings
    | will not be safe. Please do this before deploying an application!
    |
    */

    'key' => env('APP_KEY'),

    'cipher' => 'AES-256-CBC',

    /*
    |--------------------------------------------------------------------------
    | Logging Configuration
    |--------------------------------------------------------------------------
    |
    | Here you may configure the log settings for your application. Out of
    | the box, Laravel uses the Monolog PHP logging library. This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Settings: "single", "daily", "syslog", "errorlog"
    |
    */

    'log' => env('APP_LOG', 'single'),

    'log_level' => env('APP_LOG_LEVEL', 'debug'),

    /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on the
    | request to your application. Feel free to add your own services to
    | this array to grant expanded functionality to your applications.
    |
    */

    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Notifications\NotificationServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,

        /*
         * Package Service Providers...
         */
        Laravel\Tinker\TinkerServiceProvider::class,

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        // App\Providers\BroadcastServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
        // FROM: https://stackoverflow.com/questions/28847726/laravel-5-class-html-not-found
        //trying to use HTML class (KDC)
         Collective\Html\HtmlServiceProvider::class,
         'Collective\Html\HtmlServiceProvider',
    ],
    'serviceProviders' => [
        'Artisaninweb\SoapWrapper\ServiceProvider',
    ],
    /*
    |--------------------------------------------------------------------------
    | 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::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
        'Bus' => Illuminate\Support\Facades\Bus::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Notification' => Illuminate\Support\Facades\Notification::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class,
        'SoapWrapper' => Artisaninweb\SoapWrapper\Facade::class,
        //FROM: https://stackoverflow.com/questions/28847726/laravel-5-class-html-not-found
        //trying to access the HTML class
        'FORM' => Collective\Html\FormFacade::class,
        'HTML' => Collective\Html\HtmlFacade::class,
    ],

];

这是正在运行的代码片段

<li>
          <a href="{{ HTML::linkRoute('logout') }}">
          <i class="icon-key"></i> Log Out </a>
</li>

我在这里做错了什么?

TIA


没有更多了illuminate/html对于 laravel 5.* (5.0 到 5.5 以上),为了使用像 {!!Html::style('css/font-awesome.min.css')!!} 这样的代码,你必须使用laravelcollective/html

  • 在你的作曲家文件中composer.json它位于项目的根文件夹中,在所需部分添加"laravelcollective/html": "5.2.*"取决于你的 laravel 版本,所以如果你使用 laravel 5.4 应该是"laravelcollective/html": "5.4.*"你需要的部分应该看起来像"require": { "php": ">=5.6.4", "laravel/framework": "5.4.*", "laravel/tinker": "~1.0", "laravelcollective/html": "5.4.*" },

  • 使用更新你的 laravelcomposer update在你的命令提示符下

  • 然后在文件上config/app.php add Collective\Html\HtmlServiceProvider::class在提供者数组中 和'Form' => Collective\Html\FormFacade::class, 'HTML' => Collective\Html\HtmlFacade::class,在别名数组中 它应该看起来像 `'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Notifications\NotificationServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    Illuminate\Redis\RedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    // what I just add
    Collective\Html\HtmlServiceProvider::class,
    
    /*
     * Package Service Providers...
     */
    Laravel\Tinker\TinkerServiceProvider::class,
    
    /*
     * Application Service Providers...
     */
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    // App\Providers\BroadcastServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    

    ],`

` '别名' => [

    'App' => Illuminate\Support\Facades\App::class,
    'Artisan' => Illuminate\Support\Facades\Artisan::class,
    'Auth' => Illuminate\Support\Facades\Auth::class,
    'Blade' => Illuminate\Support\Facades\Blade::class,
    'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
    'Bus' => Illuminate\Support\Facades\Bus::class,
    'Cache' => Illuminate\Support\Facades\Cache::class,
    'Config' => Illuminate\Support\Facades\Config::class,
    'Cookie' => Illuminate\Support\Facades\Cookie::class,
    'Crypt' => Illuminate\Support\Facades\Crypt::class,
    'DB' => Illuminate\Support\Facades\DB::class,
    'Eloquent' => Illuminate\Database\Eloquent\Model::class,
    'Event' => Illuminate\Support\Facades\Event::class,
    'File' => Illuminate\Support\Facades\File::class,
    'Gate' => Illuminate\Support\Facades\Gate::class,
    'Hash' => Illuminate\Support\Facades\Hash::class,
    'Lang' => Illuminate\Support\Facades\Lang::class,
    'Log' => Illuminate\Support\Facades\Log::class,
    'Mail' => Illuminate\Support\Facades\Mail::class,
    'Notification' => Illuminate\Support\Facades\Notification::class,
    'Password' => Illuminate\Support\Facades\Password::class,
    'Queue' => Illuminate\Support\Facades\Queue::class,
    'Redirect' => Illuminate\Support\Facades\Redirect::class,
    'Redis' => Illuminate\Support\Facades\Redis::class,
    'Request' => Illuminate\Support\Facades\Request::class,
    'Response' => Illuminate\Support\Facades\Response::class,
    'Route' => Illuminate\Support\Facades\Route::class,
    'Schema' => Illuminate\Support\Facades\Schema::class,
    'Session' => Illuminate\Support\Facades\Session::class,
    'Storage' => Illuminate\Support\Facades\Storage::class,
    'URL' => Illuminate\Support\Facades\URL::class,
    'Validator' => Illuminate\Support\Facades\Validator::class,
    'View' => Illuminate\Support\Facades\View::class,
    //what I just add
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
],`

现在一切都应该完美地工作......

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误类“HTML”未找到 - Laravel 5.4 的相关文章

随机推荐

  • 如果屏幕上显示多个二维码,请扫描二维码

    我正在开发一个Android示例应用程序作为一个学术项目 我需要扫描二维码 我使用了二维码扫描库 如果屏幕上只有一个二维码 我能够成功检测到二维码 是的 我想扫描二维码 尽管相同的二维码一次显示在屏幕上的多个位置 例如 在我的笔记本电脑屏幕
  • Nginx:何时使用 proxy_set_header 主机 $host 与 $proxy_host

    我一直在阅读反向代理 想知道什么时候proxy set header Host host是适当的proxy set header Host proxy host 我做了一些研究本文 https www digitalocean com co
  • 在强制布局上拖动会阻止其他 mouseup 侦听器

    我想在 d3 js 强制布局中启用拖动 当拖动一个圆圈并释放鼠标按钮时 我想通过回调调用特定的函数 如下所示 this force d3 layout force nodes this nodes size this width this
  • Netty websocket客户端闲置5分钟后不从服务器读取新帧

    我在服务器端和客户端都使用 Netty 来建立和控制 websocket 连接 我在服务器端有一个空闲状态处理程序 http netty io 4 1 api io netty handler timeout IdleStateHandle
  • 在jsp页面中显示jfreechart

    我想显示一个jfreechartjsp 页面中的图表 我写的代码如下 img src chart jpg 哪里的createCategoryChart 方法创建所需的 jpg 它存储在 eclipse 文件夹中 我没有在文件名中添加任何路径
  • 强制 UIView/UIVIewController 方向

    我们正在编写一个专门处于横向模式的应用程序 我们对根视图使用变换将其旋转到 LandscapeRight 然后该视图加载的每个视图都共享坐标系 这一切都很好 除了我们的视图之一有一个由视图控制器加载的 UIWebView 对象 我们尝试查看
  • 如何将shadershop公式转换成glsl

    我最近一直在学习着色器的一些基础知识 并且想出了一个很棒的视觉工具 着色器商店 http www cdglabs org Shadershop 但我无法将我在此站点中创建的公式转换为 glsl 一个简单的例子 我在此网站中创建了一个公式 我
  • data.table 相当于 tidyr 中的complete/fill

    我有以下数据 library tidyr library dplyr gt gt Attaching package dplyr gt The following objects are masked from package stats
  • Android-状态栏通知

    我是安卓新手 我现在想知道如何在主页中创建状态通知栏 谁能帮我一些代码 提前致谢 notificationManager NotificationManager context getSystemService Context NOTIFI
  • JTable 单元格中的图像相差一个像素?

    因此 我现在可以将图像加载到 JTable 的单元格中 但由于某种原因 图形全部向右移动了一个像素 使我能够看到 JTable 的背景 有任何想法吗 抱歉 如果我的格式已关闭 仍然没有完全习惯这种标记 public static void
  • 使用 php cUrl 发送会话变量

    我正在尝试在我的应用程序内的脚本之间发送数据 问题是会话 ID 没有响应 脚本1是
  • 使用 bash 自动化点文件

    我想创建自己的自动点文件文件夹 我将使用 git 对我的点文件使用版本控制 但这与问题无关 我想要的只是符号链接中的所有文件和文件夹 dotfiles到我的主文件夹 由于我对 bash 一点都不擅长 所以我无法做到这一点 请在这件事上给予我
  • ravendb 结合搜索和Where

    我正在 C 中执行 raven 查询 并利用Where 和Search 扩展方法 我需要这两个功能 因为我只需要返回具有特定 Guid 字段的索引以及文本正文中存在的文本 不幸的是 Where 扩展方法似乎与 Search 扩展方法不兼容
  • Clojure 宏:根据条件将过滤后的映射和数量传递给其他宏

    defmacro action1 prn action1 start etype1 defmacro block bindings body let mapcat fn k v if symbol k k symbol name k v c
  • Arduino - 高效地迭代 C 数组

    我有以下数组 PROGMEM prog uint16 t show hide info 4216 8900 4380 580 500 600 500 580 1620 580 500 600 500 580 500 600 480 600
  • 将满足范围内的值的行复制到sheet2

    对于 Excel VBA 我是个新手 如果满足某些条件 我有一个任务将行从工作表 1 复制到工作表 2 在sheet1中 JY列中的值以MV列结尾 我希望您能帮我编写一个宏 将包含小于 1 的值的所有行复制到sheet2 一行可能有多个 例
  • 无法使用使用Python编写的Robot Framework自定义库

    创建了一个示例 Python 脚本 Elements py 其函数如下 from robot api deco import keyword keyword join two strings def join two strings arg
  • 通过 SNMP 访问路由表

    如果我尝试查找安装了 openWRT 的 Linksys WRT54G 的路由表 我需要哪个 MIB 那应该是MIB II SNMP 对象 ID OID 为 1 3 6 1 2 1 4 21 可转换为ip ipRouteTable 这对我在
  • 按组的 SQL 计数

    我必须遵循架构 Movie mvID title rating year Director directorID firstname lastname Genre mvID genre Direct mvID directorID 我需要知
  • 错误类“HTML”未找到 - Laravel 5.4

    我收到以下错误 未找到 HTML 类 查看 C WORK Software XamppOne htdocs APOSTXUI ContractorsClubField resources views includes header blad