-
Notifications
You must be signed in to change notification settings - Fork 26
merge: v1.16.5 #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
merge: v1.16.5 #87
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8777750
chore: Upgrade framework to v1.16.3 (auto) (#82)
hwbrzzl 89b87d2
upgrade: v1.16.4 (#85)
hwbrzzl 87ad9ca
add queue shutdown
hwbrzzl ab4ee58
chore: [#807] Add model Json example (#86)
hwbrzzl 9d97941
merge: v1.16.5
hwbrzzl d5bb1e5
optimize
hwbrzzl 7a54800
update mod
hwbrzzl c921401
optimize
hwbrzzl 5e4301a
optimize
hwbrzzl 7861ed5
update mod
hwbrzzl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package requests | ||
|
|
||
| import ( | ||
| "github.com/goravel/framework/contracts/http" | ||
| "github.com/goravel/framework/contracts/validation" | ||
| "github.com/goravel/framework/support/carbon" | ||
| "github.com/spf13/cast" | ||
| ) | ||
|
|
||
| type ValidationCreate struct { | ||
| Name string `form:"name" json:"name"` | ||
| Tags []string `form:"tags" json:"tags"` | ||
| Scores []int `form:"scores" json:"scores"` | ||
| Date carbon.Carbon `form:"date" json:"date"` | ||
| Code int `form:"code" json:"code"` | ||
| } | ||
|
|
||
| func (r *ValidationCreate) Authorize(ctx http.Context) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (r *ValidationCreate) Rules(ctx http.Context) map[string]string { | ||
| return map[string]string{ | ||
| "name": "required", | ||
| "tags.*": "required|string", | ||
| "scores.*": "required|int", | ||
| "date": "required|date", | ||
| "code": `required|regex:^\d{4,6}$`, | ||
| } | ||
| } | ||
|
|
||
| func (r *ValidationCreate) Messages(ctx http.Context) map[string]string { | ||
| return map[string]string{} | ||
| } | ||
|
|
||
| func (r *ValidationCreate) Attributes(ctx http.Context) map[string]string { | ||
| return map[string]string{} | ||
| } | ||
|
|
||
| func (r *ValidationCreate) PrepareForValidation(ctx http.Context, data validation.Data) error { | ||
| if scores, exist := data.Get("scores"); exist { | ||
| return data.Set("scores", cast.ToIntSlice(scores)) | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func (r *ValidationCreate) Filters(ctx http.Context) map[string]string { | ||
| return map[string]string{ | ||
| "name": "trim", | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.