How you show error message in blade?
Feb 26, 2018
8
Level 1
Validator array data error htmlspecialchars() expects parameter 1 to be string
this is my HTML form
<tr>
<td>
<input type="text" name="title[]" value="" class="form-control" placeholder="Enter Title">
</td>
<td>
<input type="file" class="btn-default btn" name="gallary[]" id="galary1"/>
</td>
<td>
<i class="btn btn-danger fa fa-times-circle remove-gallary" aria-hidden="true"></i>
</td>
</tr>
this is my Validator code
Validator::make(
$req->all(),
[
'title.*' => 'required',
'gallary.*' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
]
)->validate();
if i remove validator code it upload my image and create in DB but if i set Validate like above code i got error with htmlspecialchars() expects parameter 1 to be string.
how to solve it ?
Level 122
so it tells you the fact the it is in your add_edit blade file
nothing to do with validation or the controller
its saying that somewhere you put {{ $something }} and that $something is an object not a string, so in the regard you are trying to echo an object
The error trace should tell you which line of the blade file it was on.
If you still cannot spot it then you will need to paste the whole add_edit.blade.php
1 like
Please or to participate in this conversation.