Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 8718422

Browse files
committed
Importing rules from Ardent in Form::model()
1 parent a4c7679 commit 8718422

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Bllim/Laravalid/FormBuilder.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ public function open(array $options = array(), $rules = null)
8989
/**
9090
* Create a new model based form builder.
9191
*
92-
* @param array $rules Laravel validation rules
92+
* @param Ardent $model An Ardent model instance. Validation rules will be taken from it
93+
* @param array $rules Laravel validation rules
9394
*
9495
* @see Illuminate\Html\FormBuilder
9596
*/
96-
public function model($model, array $options = array(), $rules = null)
97+
public function model(Ardent $model, array $options = array())
9798
{
98-
$this->setValidation($rules);
99+
$this->setValidation($model::$rules);
99100
return parent::model($model, $options);
100101
}
101102

@@ -144,4 +145,4 @@ public function close()
144145
}
145146

146147

147-
}
148+
}

0 commit comments

Comments
 (0)