Is t...">

Laravel form inputs - how to set max length

The maximum length of HTML inputs can be set: <input type="text" name="" maxlength="10">

Is there a way to set the maximum length of form inputs when creating inputs in Laravel?

{{ Form::text('name', null, array('placeholder' => '')) }}

      

+3


source to share


2 answers


{{ Form::text('name', null, array('placeholder' => '','maxlength' => 10 )) }}

      



Works with Chrome version 39.0.2171.95 (64-bit)

+10


source


You can also check the validation as follows. For more details you can take a look at validation



$validator = Validator::make(
    array('name' => 'name'),
    array('name' => 'required|max:5')
);

      

+3


source







All Articles