I want to validate name & status.
If status = 1
else it should skip validation of name
.
When I send status = 0
it says:
name must be a string
But it should skip validation of name as per conditional validation.
When I send status=1
then it works as intended.
'status' => 'required|numeric',
'name' => 'required_if:status,1|string'
What needs to be corrected here?
You do resolve this:
public function rules()
{
$rules = [
'status' => ['required', 'numeric'],
'name' => ['string'],
];
if ($this->status == '1') {
array_push($rules['name'], 'required');
}
return $rules;
}
How do I pass a list of models from a table in a view to a controller?
How Can I Avoid “tainted by cross-origin data” on My OWN PERSONAL, locally stored, image files?
Im currently developing a extension for Typo3 87 and want to store a GET-Parameter in the session of the frontend user
I have the values of a Database query stored in a $domainsEach record looks like so: domain_23, domain_88, domain_0 etc
I'm trying to take the following data from a table:
Ola, gostaria de ajuda para fazer esse efeito usando PHP GD ou PHP & ImageMagick