Move sanitization of input to the model attribute setters. This cleans up a lot of checks in the various controller methods and ensures data will be set in the model accurately regardless of where it's set. Add unit tests for these methods (#3102)

This commit is contained in:
Daniel Meltzer
2016-12-26 18:17:46 -05:00
committed by snipe
parent fd450e2773
commit 06af9311fc
19 changed files with 403 additions and 417 deletions

View File

@@ -112,13 +112,13 @@ class StatuslabelsController extends Controller
// Save the Statuslabel data
$statusLabel->name = Input::get('name');
$statusLabel->user_id = Auth::id();
$statusLabel->notes = Input::get('notes');
$statusLabel->deployable = $statusType['deployable'];
$statusLabel->pending = $statusType['pending'];
$statusLabel->user_id = Auth::id();
$statusLabel->notes = Input::get('notes');
$statusLabel->deployable = $statusType['deployable'];
$statusLabel->pending = $statusType['pending'];
$statusLabel->archived = $statusType['archived'];
$statusLabel->color = Input::get('color');
$statusLabel->show_in_nav = Input::get('show_in_nav', 0);
$statusLabel->color = Input::get('color');
$statusLabel->show_in_nav = Input::get('show_in_nav', 0);
// Was the asset created?