I've just upgraded to Laravel 5.1 and i'm creating a simple form with "text" and "number" inputs. My problem came when i need to declare as numeric one of my input fields:
{!! Form::number('otp', null, ['class' => 'form-control', 'placeholder' => 'OTP']) !!}
It outputs this error: Method number does not exist. In addiction, i don't see the section "Html and Forms" in the docs, it seems they removed it.
Does anybody had my same problem with Laravel 5.1?
It seems some rules are changed in 5.1, so to solve this, first update the composer.json:
"require": {
"laravelcollective/html": "5.1.*"
}
then the app.php file:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
Source: http://laravelcollective.com/docs/5.1/html
You may use {!! Form::input('number', 'otp', null, ['class' => 'form-control']) !!}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With