when i go to my view, following error occurs:
FatalErrorException in 9edd5e400844b5418c6227c302e89f04657fb615.php line 3: Call to undefined function Form()
my view file :
{!!Form::open(array('url'=>'resetpwd','method'=>'PUT')) ;!!}
<p>{!!Form(password('password'));!!}</p>
{!!$errors->first('password');!!}
{!!Form::hidden('code',$code);!!}
<p> {!!Form::submit('Reset Passsword');!!} </p>
{!!Form::close();!!}
{!!$errors->first('reseterror');!!}
I am assuming you have installed Laravel Recepie. You do not declare Form::password()
method correctly.Edit your code with below changes hope it will be helped you.See how to use this method in Laravel Recepie.
Change {!!Form(password('password'));!!}
to {!!Form::password('password');!!}
Form does not come as part of core component so you need to add it to laravel. For that you need to edit the composer.json file found in the laravel main diretory. Change this line
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
TO
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*"
},
Then run composer update
in your terminal. It will add all the collectives which includes forms.
next you have to add your new provider to the providers array of config/app.php.
You will find this in your 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,
....................
NEED TO ADD THE LINE Collective\Html\HtmlServiceProvider::class,
SO Change Providers to
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Collective\Html\HtmlServiceProvider::class, ....
Last step is to add two class aliases to the aliases array of config/app.php
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,...
ADD The extra two classes FORM,HTML there
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,...
Now you can use the form in laravel.