getSize() > self::MAX_BYTES) { return false; } // Sniff actual content type rather than trusting the client-supplied // extension or Content-Type header. return in_array($file->getMimeType(), self::ALLOWED_MIME_TYPES, true); } /** * A randomized filename that never trusts the client-supplied name. */ public function randomizedFilename(UploadedFile $file): string { return Str::uuid().'.'.$file->extension(); } }