Laravel request validation image required in create but not required in update
ProductsRequest.php code:
public function rules()
{
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this -> product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this -> product_id,
'category_id' => 'required
|exists:categories,id',
'seasons_id' => 'required
|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required
|image|mimes:'.trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
These rules apply for both store and update methods.
Problem is:
I want the image to be required only on store and not required in update, since user can just update the product basic info without choosing a new image for the product every time he update the product.
What I have tried:
I have tried to create two different ProductsRequest one for store and other for update but I know that this achievement is not the best achievement because my code must be DRY.
php laravel laravel-validation
add a comment |
ProductsRequest.php code:
public function rules()
{
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this -> product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this -> product_id,
'category_id' => 'required
|exists:categories,id',
'seasons_id' => 'required
|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required
|image|mimes:'.trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
These rules apply for both store and update methods.
Problem is:
I want the image to be required only on store and not required in update, since user can just update the product basic info without choosing a new image for the product every time he update the product.
What I have tried:
I have tried to create two different ProductsRequest one for store and other for update but I know that this achievement is not the best achievement because my code must be DRY.
php laravel laravel-validation
Do you require bothcategory_idandseasons_idwhen creating the resource as well?
– Peter Sowah
Nov 23 '18 at 17:58
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24
add a comment |
ProductsRequest.php code:
public function rules()
{
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this -> product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this -> product_id,
'category_id' => 'required
|exists:categories,id',
'seasons_id' => 'required
|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required
|image|mimes:'.trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
These rules apply for both store and update methods.
Problem is:
I want the image to be required only on store and not required in update, since user can just update the product basic info without choosing a new image for the product every time he update the product.
What I have tried:
I have tried to create two different ProductsRequest one for store and other for update but I know that this achievement is not the best achievement because my code must be DRY.
php laravel laravel-validation
ProductsRequest.php code:
public function rules()
{
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this -> product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this -> product_id,
'category_id' => 'required
|exists:categories,id',
'seasons_id' => 'required
|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required
|image|mimes:'.trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
These rules apply for both store and update methods.
Problem is:
I want the image to be required only on store and not required in update, since user can just update the product basic info without choosing a new image for the product every time he update the product.
What I have tried:
I have tried to create two different ProductsRequest one for store and other for update but I know that this achievement is not the best achievement because my code must be DRY.
php laravel laravel-validation
php laravel laravel-validation
asked Nov 23 '18 at 17:45
Ahmed essam
315
315
Do you require bothcategory_idandseasons_idwhen creating the resource as well?
– Peter Sowah
Nov 23 '18 at 17:58
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24
add a comment |
Do you require bothcategory_idandseasons_idwhen creating the resource as well?
– Peter Sowah
Nov 23 '18 at 17:58
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24
Do you require both
category_id and seasons_id when creating the resource as well?– Peter Sowah
Nov 23 '18 at 17:58
Do you require both
category_id and seasons_id when creating the resource as well?– Peter Sowah
Nov 23 '18 at 17:58
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24
add a comment |
2 Answers
2
active
oldest
votes
You can do this in your ProductsRequest file;
public function rules()
{
if($request()->isMethod('put')) // could be patch as well
{
// Update rules here - Don't require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required|image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}else{
// store rules here - require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
}
}
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the$requestvariable in theProductRequest.phpfile..
– Ahmed essam
Nov 23 '18 at 19:14
add a comment |
Use required_without rules
If primary key and element with name is id exist in your array
'image' => 'required_without:id`
If primary key and element with name is product_id exist in your array
'image' => 'required_without:product_id`
You can get more detail from laravel validation
What is theidthat you wrote in the first line of code? I understand theproduct_idthat I am going to send with the patch request
– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I haveproduct_idin the update method so how I add that withrequired_with?
– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending theproduct_idin the URL and I don't have anything to differentiate between both requests exceptPOSTandPATCHrequest..
– Ahmed essam
Nov 23 '18 at 19:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451027%2flaravel-request-validation-image-required-in-create-but-not-required-in-update%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can do this in your ProductsRequest file;
public function rules()
{
if($request()->isMethod('put')) // could be patch as well
{
// Update rules here - Don't require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required|image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}else{
// store rules here - require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
}
}
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the$requestvariable in theProductRequest.phpfile..
– Ahmed essam
Nov 23 '18 at 19:14
add a comment |
You can do this in your ProductsRequest file;
public function rules()
{
if($request()->isMethod('put')) // could be patch as well
{
// Update rules here - Don't require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required|image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}else{
// store rules here - require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
}
}
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the$requestvariable in theProductRequest.phpfile..
– Ahmed essam
Nov 23 '18 at 19:14
add a comment |
You can do this in your ProductsRequest file;
public function rules()
{
if($request()->isMethod('put')) // could be patch as well
{
// Update rules here - Don't require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required|image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}else{
// store rules here - require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
}
}
You can do this in your ProductsRequest file;
public function rules()
{
if($request()->isMethod('put')) // could be patch as well
{
// Update rules here - Don't require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'required|image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}else{
// store rules here - require image here
return [
'name' => 'required
|min:'.trans('validation_standards.names.min').'
|max:'.trans('validation_standards.names.max').'
|unique:products,name,'.$this->product_id,
'barcode' => 'size:'.trans('validation_standards.barcode.size').'
|unique:products,barcode,'.$this->product_id,
'category_id' => 'required|exists:categories,id',
'seasons_id' => 'required|exists:seasons,id',
// REQUIRED IMAGE ONLY IN STORE
'image' => 'image|mimes:'.
trans('validation_standards.images.extensions').'
|max:'.trans('validation_standards.images.file_size'),
'description' => 'nullable
|min:'.trans('validation_standards.descriptions.min').'
|max:'.trans('validation_standards.descriptions.max'),
];
}
}
}
edited Nov 23 '18 at 21:41
answered Nov 23 '18 at 17:55
Peter Sowah
427110
427110
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the$requestvariable in theProductRequest.phpfile..
– Ahmed essam
Nov 23 '18 at 19:14
add a comment |
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the$requestvariable in theProductRequest.phpfile..
– Ahmed essam
Nov 23 '18 at 19:14
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I will try this solution
– Ahmed essam
Nov 23 '18 at 18:32
I don't have the
$request variable in the ProductRequest.php file..– Ahmed essam
Nov 23 '18 at 19:14
I don't have the
$request variable in the ProductRequest.php file..– Ahmed essam
Nov 23 '18 at 19:14
add a comment |
Use required_without rules
If primary key and element with name is id exist in your array
'image' => 'required_without:id`
If primary key and element with name is product_id exist in your array
'image' => 'required_without:product_id`
You can get more detail from laravel validation
What is theidthat you wrote in the first line of code? I understand theproduct_idthat I am going to send with the patch request
– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I haveproduct_idin the update method so how I add that withrequired_with?
– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending theproduct_idin the URL and I don't have anything to differentiate between both requests exceptPOSTandPATCHrequest..
– Ahmed essam
Nov 23 '18 at 19:13
add a comment |
Use required_without rules
If primary key and element with name is id exist in your array
'image' => 'required_without:id`
If primary key and element with name is product_id exist in your array
'image' => 'required_without:product_id`
You can get more detail from laravel validation
What is theidthat you wrote in the first line of code? I understand theproduct_idthat I am going to send with the patch request
– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I haveproduct_idin the update method so how I add that withrequired_with?
– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending theproduct_idin the URL and I don't have anything to differentiate between both requests exceptPOSTandPATCHrequest..
– Ahmed essam
Nov 23 '18 at 19:13
add a comment |
Use required_without rules
If primary key and element with name is id exist in your array
'image' => 'required_without:id`
If primary key and element with name is product_id exist in your array
'image' => 'required_without:product_id`
You can get more detail from laravel validation
Use required_without rules
If primary key and element with name is id exist in your array
'image' => 'required_without:id`
If primary key and element with name is product_id exist in your array
'image' => 'required_without:product_id`
You can get more detail from laravel validation
edited Nov 23 '18 at 18:52
answered Nov 23 '18 at 17:53
C2486
19k32666
19k32666
What is theidthat you wrote in the first line of code? I understand theproduct_idthat I am going to send with the patch request
– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I haveproduct_idin the update method so how I add that withrequired_with?
– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending theproduct_idin the URL and I don't have anything to differentiate between both requests exceptPOSTandPATCHrequest..
– Ahmed essam
Nov 23 '18 at 19:13
add a comment |
What is theidthat you wrote in the first line of code? I understand theproduct_idthat I am going to send with the patch request
– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I haveproduct_idin the update method so how I add that withrequired_with?
– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending theproduct_idin the URL and I don't have anything to differentiate between both requests exceptPOSTandPATCHrequest..
– Ahmed essam
Nov 23 '18 at 19:13
What is the
id that you wrote in the first line of code? I understand the product_id that I am going to send with the patch request– Ahmed essam
Nov 23 '18 at 18:32
What is the
id that you wrote in the first line of code? I understand the product_id that I am going to send with the patch request– Ahmed essam
Nov 23 '18 at 18:32
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
Ok then just use what you have in array.
– C2486
Nov 23 '18 at 18:34
I have
product_id in the update method so how I add that with required_with?– Ahmed essam
Nov 23 '18 at 18:37
I have
product_id in the update method so how I add that with required_with?– Ahmed essam
Nov 23 '18 at 18:37
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
Sorry its my bad you need to use 'required_without'
– C2486
Nov 23 '18 at 18:53
The problem is that I am sending the
product_id in the URL and I don't have anything to differentiate between both requests except POST and PATCH request..– Ahmed essam
Nov 23 '18 at 19:13
The problem is that I am sending the
product_id in the URL and I don't have anything to differentiate between both requests except POST and PATCH request..– Ahmed essam
Nov 23 '18 at 19:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451027%2flaravel-request-validation-image-required-in-create-but-not-required-in-update%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you require both
category_idandseasons_idwhen creating the resource as well?– Peter Sowah
Nov 23 '18 at 17:58
@PeterSowah yes because both of them may be updated and both of them is required
– Ahmed essam
Nov 23 '18 at 18:24