在你们中的任何版主将其标记为重复之前,我敦促您考虑这样一个事实,即我已经搜索了 SO 并在谷歌上搜索了 Laravel 6 关于我的问题的特定主题,并且只找到了特定于 6 的一件事。如果有人可以帮助解决这个问题,我相信这将帮助大量的Laravel开发人员。所以,请认真对待这种情况,不仅是为了我,也是为了社区?
当我尝试加载我的页面时,该页面正在使用有问题的 HTML 类;
{{ HTML::style('assets/css/bootstrap.min.css') }}
对于我的 CSS 文件和对我的 js 文件的相应 HTML::script 调用,我不断得到的报告是;
Class 'HTML' not found (View: /Users/pshore/PhpstormProjects/upeeps/resources/views/subpages/header.blade.php)
首先,我已经访问了这个SO帖子,并且;
这没有解决我的问题
所以,我现在提供我的composer.json内容,我的配置/应用程序.php内容,希望有人会看到我的配置中导致此错误的错误。
我已经尝试了从将我的 laravel 降级到 5.8.35 到在这里和 Google 上为 Laravel 5 找到的大量东西的所有方法,但 Laravel 6 几乎没有关于这个问题的任何内容。所以,我已经陷入了死胡同,除了在这里发帖之外,我再也想不出一个好的下一步了。
作曲家.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^6.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
配置/应用程序.php
'providers' => [
/*
* Laravel Framework Service Providers...
*/
IlluminateAuthAuthServiceProvider::class,
IlluminateBroadcastingBroadcastServiceProvider::class,
IlluminateBusBusServiceProvider::class,
IlluminateCacheCacheServiceProvider::class,
IlluminateFoundationProvidersConsoleSupportServiceProvider::class,
IlluminateCookieCookieServiceProvider::class,
IlluminateDatabaseDatabaseServiceProvider::class,
IlluminateEncryptionEncryptionServiceProvider::class,
IlluminateFilesystemFilesystemServiceProvider::class,
IlluminateFoundationProvidersFoundationServiceProvider::class,
IlluminateHashingHashServiceProvider::class,
IlluminateMailMailServiceProvider::class,
IlluminateNotificationsNotificationServiceProvider::class,
IlluminatePaginationPaginationServiceProvider::class,
IlluminatePipelinePipelineServiceProvider::class,
IlluminateQueueQueueServiceProvider::class,
IlluminateRedisRedisServiceProvider::class,
IlluminateAuthPasswordsPasswordResetServiceProvider::class,
IlluminateSessionSessionServiceProvider::class,
IlluminateTranslationTranslationServiceProvider::class,
IlluminateValidationValidationServiceProvider::class,
IlluminateViewViewServiceProvider::class,
CollectiveHtmlHtmlServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
AppProvidersAppServiceProvider::class,
AppProvidersAuthServiceProvider::class,
// AppProvidersBroadcastServiceProvider::class,
AppProvidersEventServiceProvider::class,
AppProvidersRouteServiceProvider::class,
],
'aliases' => [
'App' => IlluminateSupportFacadesApp::class,
'Arr' => IlluminateSupportArr::class,
'Artisan' => IlluminateSupportFacadesArtisan::class,
'Auth' => IlluminateSupportFacadesAuth::class,
'Blade' => IlluminateSupportFacadesBlade::class,
'Broadcast' => IlluminateSupportFacadesBroadcast::class,
'Bus' => IlluminateSupportFacadesBus::class,
'Cache' => IlluminateSupportFacadesCache::class,
'Config' => IlluminateSupportFacadesConfig::class,
'Cookie' => IlluminateSupportFacadesCookie::class,
'Crypt' => IlluminateSupportFacadesCrypt::class,
'DB' => IlluminateSupportFacadesDB::class,
'Eloquent' => IlluminateDatabaseEloquentModel::class,
'Event' => IlluminateSupportFacadesEvent::class,
'File' => IlluminateSupportFacadesFile::class,
'Gate' => IlluminateSupportFacadesGate::class,
'Hash' => IlluminateSupportFacadesHash::class,
'Lang' => IlluminateSupportFacadesLang::class,
'Log' => IlluminateSupportFacadesLog::class,
'Mail' => IlluminateSupportFacadesMail::class,
'Notification' => IlluminateSupportFacadesNotification::class,
'Password' => IlluminateSupportFacadesPassword::class,
'Queue' => IlluminateSupportFacadesQueue::class,
'Redirect' => IlluminateSupportFacadesRedirect::class,
'Redis' => IlluminateSupportFacadesRedis::class,
'Request' => IlluminateSupportFacadesRequest::class,
'Response' => IlluminateSupportFacadesResponse::class,
'Route' => IlluminateSupportFacadesRoute::class,
'Schema' => IlluminateSupportFacadesSchema::class,
'Session' => IlluminateSupportFacadesSession::class,
'Storage' => IlluminateSupportFacadesStorage::class,
'Str' => IlluminateSupportStr::class,
'URL' => IlluminateSupportFacadesURL::class,
'Validator' => IlluminateSupportFacadesValidator::class,
'View' => IlluminateSupportFacadesView::class,
'Form' => CollectiveHtmlFormFacade::class,
'Html' => CollectiveHtmlHtmlFacade::class
],
您可能希望为此使用确切的别名类名(区分大小写(,Html
基于您的配置:
{{ HTML::style('assets/css/bootstrap.min.css') }}
// would become
{{ Html::style('assets/css/bootstrap.min.css') }}
包本身使用自动发现功能,因此您不必自己包含服务提供商或别名。它将为您别名HtmlBuilder
Html
和FormBuilder
Form
。