Skip to content

Commit

Permalink
Support Laravel 5.4.23
Browse files Browse the repository at this point in the history
  • Loading branch information
madnh committed May 17, 2017
1 parent 5f430a4 commit c3580cb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/FormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public function open(array $options = [])
*/
public function input($type, $name, $value = null, $options = [])
{
if ($this->parsley != null)
{
if ($this->parsley != null) {
$options = array_merge($options, $this->parsley->getFieldRules($name));
}

Expand All @@ -39,21 +38,19 @@ public function input($type, $name, $value = null, $options = [])
*/
public function textarea($name, $value = null, $options = [])
{
if ($this->parsley != null)
{
if ($this->parsley != null) {
$options = array_merge($options, $this->parsley->getFieldRules($name));
}

return parent::textarea($name, $value, $options);
}

public function select($name, $list = [], $selected = null, $options = [])
public function select($name, $list = [], $selected = null, array $selectAttributes = [], array $optionsAttributes = [])
{
if ($this->parsley != null)
{
$options = array_merge($options, $this->parsley->getFieldRules($name));
if ($this->parsley != null) {
$selectAttributes = array_merge($selectAttributes, $this->parsley->getFieldRules($name));
}

return parent::select($name, $list, $selected, $options);
return parent::select($name, $list, $selected, $selectAttributes, $optionsAttributes);
}
}

0 comments on commit c3580cb

Please sign in to comment.