| 1 | <?php |
||
| 15 | class FormFactory implements Factory |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The view factory. |
||
| 19 | * |
||
| 20 | * @var View |
||
| 21 | */ |
||
| 22 | private $view; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The translator. |
||
| 26 | * |
||
| 27 | * @var Translator |
||
| 28 | */ |
||
| 29 | private $translator; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * The config repository. |
||
| 33 | * |
||
| 34 | * @var Config |
||
| 35 | */ |
||
| 36 | private $config; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * FormFactory constructor. |
||
| 40 | * |
||
| 41 | * @param View $view |
||
| 42 | * @param Translator $translator |
||
| 43 | * @param Config $config |
||
| 44 | */ |
||
| 45 | public function __construct(View $view, Translator $translator, Config $config) { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Make a form instance by using the rules. |
||
| 53 | * |
||
| 54 | * @param array $rules |
||
| 55 | * @param Model|null $model |
||
| 56 | * @param array $attributes |
||
| 57 | * @param array $messages |
||
| 58 | * @return Form |
||
| 59 | */ |
||
| 60 | public function make(array $rules, Model $model = null, array $attributes = [], array $messages = []) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Make a form instance by using the form request. |
||
| 67 | * |
||
| 68 | * @param $formRequest |
||
| 69 | * @param Model $model |
||
| 70 | * @return Form |
||
| 71 | */ |
||
| 72 | public function makeFromRequest($formRequest, Model $model) |
||
| 76 | } |