@@ -12,11 +12,16 @@ use Illuminate\Support\Str;
|
||||
|
||||
class OpportunityImageProcessor
|
||||
{
|
||||
public function available(): bool
|
||||
{
|
||||
return function_exists('imagecreatefromstring') && function_exists('imagewebp');
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $input */
|
||||
public function prepare(User $actor, int $opportunityId, string $id, array $input): void
|
||||
{
|
||||
abort_unless($actor->can('manage-portal'), 403);
|
||||
abort_unless(function_exists('imagecreatefromstring') && function_exists('imagewebp'), 423, 'GD/WebP não disponível neste processo. Original e metadados preservados; processamento pendente.');
|
||||
abort_unless($this->available(), 423, 'GD/WebP não disponível neste processo. Original e metadados preservados; processamento pendente.');
|
||||
$data = validator($input, ['etag' => 'required|string|size:64', 'version' => 'required|integer|min:1', 'reason' => 'required|string|min:20|max:1000'])->validate();
|
||||
$stored = [];
|
||||
$documents = [];
|
||||
|
||||
Reference in New Issue
Block a user