Pulled Dingo back to 0.6.* - Basic Auth not working with new version
This commit is contained in:
@@ -18,9 +18,7 @@
|
||||
$component = new $this->model($array);
|
||||
$component->user_id = $user_id;
|
||||
|
||||
if ($component->isInvalid()) {
|
||||
throw new Exception('Invalid model validation', $component->getErrors());
|
||||
}
|
||||
$this->validate($component);
|
||||
|
||||
$component->saveOrFail();
|
||||
return $component;
|
||||
|
||||
@@ -100,4 +100,15 @@
|
||||
$model = $this->model->whereId($id)->first(['id']);
|
||||
$model->update($array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a given model with Watson validation
|
||||
* @param object $model
|
||||
* @return Exception
|
||||
*/
|
||||
public function validate($model) {
|
||||
if ($model->isInvalid()) {
|
||||
throw new Exception('Invalid model validation');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ return array(
|
||||
'Illuminate\View\ViewServiceProvider',
|
||||
'Illuminate\Workbench\WorkbenchServiceProvider',
|
||||
|
||||
'Dingo\Api\Provider\ApiServiceProvider',
|
||||
'Dingo\Api\ApiServiceProvider',
|
||||
'Thujohn\Rss\RssServiceProvider',
|
||||
|
||||
'CachetHQ\Cachet\Support\ServiceProviders\RepositoryServiceProvider',
|
||||
|
||||
Reference in New Issue
Block a user