1
I’m having a hard time trying to create a form on Laravel
5.4, at the time of loading View
appears the following error:
"Errorexception in helpers.php line 532: htmlspecialchars() expects Parameter 1 to be string, array Given (View:/var/www/html/control/Resources/views/users/create.blade.php)"
My View
is like this:
<div>
{{ Form::open(array('url' => 'users')) }}
<div class="form-group">
{{ Form::label('name', 'Name') }}
{{ Form::text('name', array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('email', 'Email') }}
{{ Form::email('email', array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('nerd_level', 'User Level') }}
{{ Form::select('nerd_level', array('0' => 'Nomal', '1' => 'Admin'), array('class' => 'form-control')) }}
</div>
{{ Form::submit('Create the User!', array('class' => 'btn btn-primary')) }}
{{ Form::close() }}
</div>
Someone would know how to fix it?
Form::email
also right?– Guilherme Nascimento
@Guilhermenascimento yes, all of them. Is that the second parameter equals to
value
ofinput
. Only theForm::select
which changes the order, which in this case is in the third parameter.– Wallace Maxters
now it worked, but when I click the button, the page recharges and the data is not saved in the database!
– Samuel de souza
@Samueldesouza there would be another problem. I suggest you ask a new question
– Wallace Maxters