arshad
arshad

Reputation: 369

I found error "Class 'Form' not found" while creating a simple form in laravel

Screenshort from error: enter image description here

I just create simple form having the following code. When i install composer require "laravelcollective/html":"^5.4.0" from laravel collective it also give error in terminal. please give any guidance . answer will be appreciated.

@extends('layout.app')
@section('content')
  <h2>Create</h2>
  {!! Form::open(['action' => 'PostsController/store', 'method' => 'POST']) !!}`enter code here`
    <div class="form-group">
      {{form::lable('title','Title')}}
      {{form::text('title','',['class'=>'form-control','placeholder'=>'title'])}}

    </div>
  {!! Form::close() !!}

@endsection

Upvotes: 1

Views: 237

Answers (1)

S_R
S_R

Reputation: 1998

You need to make sure you add the form provider into your config providers and aliases like so.

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

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

Please find full instructions here

Upvotes: 1

Related Questions