当前位置: 首页 > 知识库问答 >
问题:

未找到Laravel 5.4类'form'

狄宜然
2023-03-14

我面临“类”表单“未找到”的问题,我目前正在使用laravel 5.4。我已经尽了最大的努力来解决这个问题。

谢谢

错误是:哎呀,看起来好像出了什么问题。

1/1

d0b19e04e5a1f8a5507d8ca427362b23807103ca.php行23中的FatalErrorException:在d0b19e04e5a1f8a5507d8ca427362b23807103ca.php行23中未找到类“Form”

这是我的Comp

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

我运行作曲家更新命令。

这是我的app.php

'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\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    'Collective\Html\HtmlServiceProvider',


    /*
     * 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,

],

/*
|--------------------------------------------------------------------------
| 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,
    'FORM' => 'Collective\Html\FormFacade',
    'HTML' => 'Collective\Html\HtmlFacade',
],

];

在formupload.blade.php中使用表单

@if(isset($success))
    <div class="alert alert-success"> {{$success}} </div>
@endif
    {!! Form::open(['action'=>'ImageController@store', 'files'=>true]) !!}

    <div class="form-group">
        {!! Form::label('title', 'Title:') !!}
        {!! Form::text('title', null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('description', 'Description:') !!}
        {!! Form::textarea('description', null, ['class'=>'form-control', 'rows'=>5] ) !!}
    </div>

    <div class="form-group">
        {!! Form::label('image', 'Choose an image') !!}
        {!! Form::file('image') !!}
    </div>

    <div class="form-group">
        {!! Form::submit('Save', array( 'class'=>'btn btn-danger form-control' )) !!}
    </div>

    {!! Form::close() !!}
    <div class="alert-warning">
        @foreach( $errors->all() as $error )
           <br> {{ $error }}
        @endforeach
    </div>

</div>

共有3个答案

孟开宇
2023-03-14

运行命令

 composer require laravelcollective/html

当作曲家更新需要的html laravel集体,然后将这两行添加到配置/app.php到
别名的部分=

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

然后将该行添加到config/app.php
“providers”=

Collective\Html\HtmlServiceProvider::class,
宋育
2023-03-14

看起来您在app.php中将表单类的别名设置为“表单”:

“表单”=

尝试将其更改为表单,如下所示:

'Form'=

那应该能行

阮喜
2023-03-14

把这个放进composer.json

"require": {
        "laravelcollective/html": "^5.4"
 },

然后跑

composer update 

事后指挥

composer require laravelcollective/html

然后将其添加到config/app.php的providers部分数组中

Collective\Html\HtmlServiceProvider::class,

之后添加两个类别名在配置/app.php在别名数组

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
 类似资料:
  • 我用Android Studio为Unity做了一个jar插件。我的插件使用。但找不到该类。Unity的控制台向我显示了以下错误:

  • 我不知道如何处理以下错误,我已经搜索了网络,但没有找到任何东西: 以及: 我在gradle应用程序中的依赖项:

  • 我试图从netbeans连接到sqlite,但它没有得到我的conexion类 这是我的代码: 这是我的错误: Java语言lang.NoClassDefFoundError:Petrocabimas\u app/Conexion(错误名称:Petrocabimas\u app/Conexion)。lang.ClassLoader。在java中定义Class1(本机方法)。lang.ClassLo

  • 之前,我的程序运行良好。但当我刚刚将我的Android studio更新到最新版本(2.2于2016年9月15日发布)时,我出现了以下错误。当我构建它时,它会显示:Build Successfully,但当我运行程序时会出现以下错误: E/AndroidRuntime:致命异常:主进程:com。实例androidtutorial,PID:28293 java。lang.RuntimeExcepti

  • 首先感谢你花时间来帮助我。我的名字是Matt,我一直在努力学习java,并创建mc插件。我一直在尝试为MC制作一个具有深入学习的插口插件。我正在尝试使用deeplearning4j。我知道我可以把这个问题放到spigotmc的网站上,但我不认为他们会很有帮助,因为从以前在spigotmc上的帖子来看,他们中的很多人似乎对dl4j不太了解。因此,到目前为止,我所做的是使用dl4j网站上的快速入门指南