File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,8 @@ Accept: application/vnd.api+json
161161 "type": "posts",
162162 "attributes": {
163163 "title": "Hello World",
164- "content": "..."
164+ "content": "...",
165+ "another-field": "..."
165166 },
166167 "relationships": {
167168 "author": {
@@ -195,6 +196,7 @@ Your validator will be provided with the following array of data:
195196 "id" => null,
196197 "title" => "Hello World",
197198 "content" => "...",
199+ "another-field" => "...",
198200 "author" => ["type" => "users", "id" => "123"],
199201 "tags" => [
200202 ["type" => "tags", "id" => "1"],
@@ -221,6 +223,7 @@ class Validators extends AbstractValidators
221223 return [
222224 'title' => 'required|string|min:1|max:255',
223225 'content' => 'required|string|min:1',
226+ "another-field" => 'string|unique:posts,another_field',
224227 'author' => [
225228 'required',
226229 new HasOne('users'),
You can’t perform that action at this time.
0 commit comments