Skip to content

Commit

Permalink
Merge pull request #7 from webman-tech/6-valiator-未定义
Browse files Browse the repository at this point in the history
docs: update
  • Loading branch information
krissss authored Feb 24, 2023
2 parents 3d37179 + 6014898 commit 50429f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class FooController
{
public function bar(Request $request)
{
$validator = valiator($request->post(), [
$validator = validator($request->post(), [
'title' => 'required|unique:posts|max:255',
'body' => 'required',
]);
if ($validator->fails()) {
return json($validator->errors->first());
return json($validator->errors()->first());
}
return json('ok');
}
Expand Down Expand Up @@ -68,11 +68,11 @@ class FooController
{
public function bar(Request $request)
{
$validator = valiator(LaravelRequest::wrapper($request)->all(), [
$validator = validator(LaravelRequest::wrapper($request)->all(), [
'file' => 'required|file|image',
]);
if ($validator->fails()) {
return json($validator->errors->first());
return json($validator->errors()->first());
}
return json('ok');
}
Expand Down

0 comments on commit 50429f4

Please sign in to comment.