Skip to content

Commit 5f5023e

Browse files
author
Nikita Teryaev
committed
fix logic for tests2
1 parent d13d4cf commit 5f5023e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

app/Library/Form/FormModel.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ public function __construct(ValidatorInterface $validator, $repository)
5050
*/
5151
public function process(array $input)
5252
{
53-
if($this->v->validate($input))
54-
{
55-
try{
56-
$model = $this->r->getModel();
53+
54+
if (method_exists($this->r, 'getModel')) {
55+
$model = $this->r->getModel();
56+
if ($model instanceof \Illuminate\Database\Eloquent\Model) {
5757
$table_name = (new $model)->getTable();
5858
if ($table_name) {
5959
$input['_table_name'] = $table_name;
6060
}
61-
} catch (\Exception $e) {
62-
6361
}
62+
}
6463

64+
65+
66+
if($this->v->validate($input))
67+
{
6568
Event::fire("form.processing", array($input));
6669
return $this->callRepository($input);
6770
}

0 commit comments

Comments
 (0)