The trait Illuminate\Validation\Concerns\ValidatesAttributes requires some properties which are not provided by Thinktomorrow\Chief\Fiel...\AbstractMediaFieldRule: $data, $container, $currentRule, $implicitAttributes
The trait Thinktomorrow\Chief\Fiel...ExistingAssetAttributes requires some properties which are not provided by Thinktomorrow\Chief\Fiel...\AbstractMediaFieldRule: $media, $size
Loading history...
12
ValidatesExistingAssetAttributes;
13
14
protected function normalizePayload($value): array
15
{
16
$payload = $this->emptyPayload();
17
18
if(!$value || !is_array($value)) return $payload;
19
20
foreach([MediaRequest::NEW, MediaRequest::REPLACE, MediaRequest::DETACH] as $action) {
21
if(isset($value[$action])){
22
$payload[$action] = $value[$action];
23
}
24
}
25
26
return $payload;
27
}
28
29
private function emptyPayload(): array
30
{
31
return [
32
MediaRequest::NEW => [],
33
MediaRequest::REPLACE => [],
34
MediaRequest::DETACH => [],
35
];
36
}
37
38
/**
39
* Default getSize method
40
*
41
* Override the default getSize from ValidatesAttributes to avoid calls to a hasRule method