lundi 25 janvier 2016

Validation Throwing hard errors instead of validation rule errors

I have a view with a field like this

{!! Form::open(array('url' => 'manufacturers/'.$manufacturer->id , 'method' => 'put')) !!}

<div class="col-lg-6">
   {!! Form::text('manufacturer_name', $vehicle->manufacturer_name, array('placeholder' => 'Manufacturer Name', 'class' => 'form-control', 'required' => '')) !!}
</div>

{!! Form::close() !!}

And in my Validation Rules i have

return [
'manufacturer_name' => 'required|max:20'
];

If i a add more than 20 characters in the manufacturer_name, i recieve the below error.

htmlentities() expects parameter 1 to be string, array given

Now if i increase the max value to 30 the data is added to the db just fine. But Laravel should send back nice validation errors not the hard php errors.

As always any help is appreciated.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JxC7Ko
via IFTTT

Aucun commentaire:

Enregistrer un commentaire