LoginSignup
18
11

More than 3 years have passed since last update.

Laravelで「Formクラスが無い」とエラーが出た時の対処法

Posted at

Class 'Form' not foundと出た

チュートリアルを元にLaravelでアプリを作っていた際に、Formという機能を使ったのですが使用できなくて焦りました。
Laravelのバージョンは5.7だったので古いという訳でも無いです。

どうも各種追記をしないといけないようです。

composer.jsonに追記

composer.json
    "require": {
        "laravelcollective/html": "~5.0"
    },
$ composer update

app.phpに追記

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

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

これでFormが使えるようになりました!

18
11
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
11