File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Then, to load the plugin either run the following command:
20
20
bin/cake plugin load JsonApiException
21
21
```
22
22
23
- or manually add the following line to your app's ` src/Application.php ` file's ` bootstrap() ` function:
23
+ or manually add the following line to your app's ` src/Application.php ` file's ` bootstrap() ` function:
24
24
25
25
``` php
26
26
$this->addPlugin('JsonApiException');
@@ -43,6 +43,7 @@ public function add()
43
43
$user = $this->Users->patchEntity($user, $this->request->getData());
44
44
if (!$this->Users->save($user)) {
45
45
throw new JsonApiException($user, 'Save failed');
46
+ // throw new JsonApiException($user, 'Save failed', 418); // you set the response's status code in the 3rd parameter
46
47
}
47
48
}
48
49
$this->set(compact('user'));
You can’t perform that action at this time.
0 commit comments