Skip to content

Commit a2110fc

Browse files
committed
Fixed Bug In Default Validation Behaviour
Signed-off-by: David Thorpe <[email protected]>
1 parent 0294105 commit a2110fc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Davzie/LaravelBootstrap/Core/EloquentBaseRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function requireById($id)
8585
return $model;
8686
}
8787

88-
public function getNew($attributes = array())
88+
public function getNew( $attributes = array() )
8989
{
9090
return $this->model->newInstance($attributes);
9191
}

src/controllers/ObjectBaseController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract class ObjectBaseController extends BaseController {
7171
* inputs from Input::all() not from $model->fill();
7272
* @var boolean
7373
*/
74-
protected $validateWithInput = true;
74+
protected $validateWithInput = false;
7575

7676
public function __construct()
7777
{
@@ -149,8 +149,7 @@ public function getDelete( $id ){
149149
*/
150150
public function postNew()
151151
{
152-
$record = $this->model->getNew();
153-
$record->fill( Input::all() );
152+
$record = $this->model->getNew( Input::all() );
154153

155154
$valid = $this->validateWithInput === true ? $record->isValid( Input::all() ) : $record->isValid();
156155

0 commit comments

Comments
 (0)