Pulled Dingo back to 0.6.* - Basic Auth not working with new version

This commit is contained in:
Elliot Hesp
2014-11-27 19:36:40 +00:00
parent 1383e45f9d
commit f44871a92e
5 changed files with 41 additions and 34 deletions

View File

@@ -18,9 +18,7 @@
$component = new $this->model($array); $component = new $this->model($array);
$component->user_id = $user_id; $component->user_id = $user_id;
if ($component->isInvalid()) { $this->validate($component);
throw new Exception('Invalid model validation', $component->getErrors());
}
$component->saveOrFail(); $component->saveOrFail();
return $component; return $component;

View File

@@ -100,4 +100,15 @@
$model = $this->model->whereId($id)->first(['id']); $model = $this->model->whereId($id)->first(['id']);
$model->update($array); $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');
}
}
} }

View File

@@ -122,7 +122,7 @@ return array(
'Illuminate\View\ViewServiceProvider', 'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider', 'Illuminate\Workbench\WorkbenchServiceProvider',
'Dingo\Api\Provider\ApiServiceProvider', 'Dingo\Api\ApiServiceProvider',
'Thujohn\Rss\RssServiceProvider', 'Thujohn\Rss\RssServiceProvider',
'CachetHQ\Cachet\Support\ServiceProviders\RepositoryServiceProvider', 'CachetHQ\Cachet\Support\ServiceProviders\RepositoryServiceProvider',

View File

@@ -7,7 +7,7 @@
"require": { "require": {
"laravel/framework": "4.2.*", "laravel/framework": "4.2.*",
"guzzlehttp/guzzle": "~5.0", "guzzlehttp/guzzle": "~5.0",
"dingo/api": "0.7.*", "dingo/api": "0.6.*",
"watson/validating": "0.10.*", "watson/validating": "0.10.*",
"thujohn/rss": "dev-master" "thujohn/rss": "dev-master"
}, },

56
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "62ab8c6b87bf3b5342d449b46df2d76b", "hash": "a869e5c2586d00bb96110dc4fd24e123",
"packages": [ "packages": [
{ {
"name": "classpreloader/classpreloader", "name": "classpreloader/classpreloader",
@@ -89,45 +89,43 @@
}, },
{ {
"name": "dingo/api", "name": "dingo/api",
"version": "v0.7.0", "version": "v0.6.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dingo/api.git", "url": "https://github.com/dingo/api.git",
"reference": "eea61d886bab386785f619d4c470d350e81f6435" "reference": "87ce1b823941deddf266d2fcbf537145c0530716"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dingo/api/zipball/eea61d886bab386785f619d4c470d350e81f6435", "url": "https://api.github.com/repos/dingo/api/zipball/87ce1b823941deddf266d2fcbf537145c0530716",
"reference": "eea61d886bab386785f619d4c470d350e81f6435", "reference": "87ce1b823941deddf266d2fcbf537145c0530716",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/support": "~4.1", "illuminate/support": "~4.1|~5.0",
"league/fractal": "0.10.*", "league/fractal": "0.8.*",
"php": ">=5.4.0" "php": ">=5.4.0"
}, },
"require-dev": { "require-dev": {
"illuminate/auth": "4.2.*", "illuminate/auth": "~4.1",
"illuminate/console": "4.2.*", "illuminate/console": "~4.1",
"illuminate/database": "4.2.*", "illuminate/database": "~4.1",
"illuminate/events": "4.2.*", "illuminate/events": "~4.1",
"illuminate/filesystem": "4.2.*", "illuminate/pagination": "~4.1",
"illuminate/pagination": "4.2.*", "illuminate/routing": "~4.1",
"illuminate/routing": "4.2.*", "lucadegasperi/oauth2-server-laravel": "1.0.*",
"lucadegasperi/oauth2-server-laravel": "3.0.*",
"mockery/mockery": "~0.9", "mockery/mockery": "~0.9",
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~1.5", "squizlabs/php_codesniffer": "1.*"
"tymon/jwt-auth": "0.3.*"
}, },
"suggest": { "suggest": {
"lucadegasperi/oauth2-server-laravel": "Use the League OAuth 2.0 server to protect your API.", "lucadegasperi/oauth2-server-laravel": "Use the League OAuth 2.0 server to protect your API."
"tymon/jwt-auth": "Protect your API with JSON Web Tokens"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "0.7-dev" "dev-master": "0.6-dev",
"dev-develop": "0.7-dev"
} }
}, },
"autoload": { "autoload": {
@@ -152,7 +150,7 @@
"laravel", "laravel",
"restful" "restful"
], ],
"time": "2014-11-27 00:56:56" "time": "2014-09-29 00:06:33"
}, },
{ {
"name": "filp/whoops", "name": "filp/whoops",
@@ -577,16 +575,16 @@
}, },
{ {
"name": "league/fractal", "name": "league/fractal",
"version": "0.10.0", "version": "0.8.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/fractal.git", "url": "https://github.com/thephpleague/fractal.git",
"reference": "557e1803dabe8ce252a4549a29da6d439f62d3c2" "reference": "9985eee7efc42ef472da07856cdd3fd29c57642c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/fractal/zipball/557e1803dabe8ce252a4549a29da6d439f62d3c2", "url": "https://api.github.com/repos/thephpleague/fractal/zipball/9985eee7efc42ef472da07856cdd3fd29c57642c",
"reference": "557e1803dabe8ce252a4549a29da6d439f62d3c2", "reference": "9985eee7efc42ef472da07856cdd3fd29c57642c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -604,7 +602,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "0.10-dev" "dev-master": "0.8-dev"
} }
}, },
"autoload": { "autoload": {
@@ -619,8 +617,8 @@
"authors": [ "authors": [
{ {
"name": "Phil Sturgeon", "name": "Phil Sturgeon",
"email": "me@philsturgeon.uk", "email": "email@philsturgeon.co.uk",
"homepage": "http://philsturgeon.uk/", "homepage": "http://philsturgeon.co.uk/",
"role": "Developer" "role": "Developer"
} }
], ],
@@ -632,7 +630,7 @@
"league", "league",
"rest" "rest"
], ],
"time": "2014-10-17 17:12:38" "time": "2014-06-14 11:11:41"
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",