Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Qcloud Content Audit Laravel Package

overtrue/laravel-qcloud-content-audit

Laravel integration for Tencent Cloud content audit (QCloud CMS), helping you moderate user-generated text and images for sensitive or unsafe content. Simple configuration and an easy-to-use API make it quick to add content safety checks to Laravel apps.

View on GitHub
Deep Wiki
Context7

Getting Started

This package (5.0.0) is an image-handling layer for Laravel: it wires up an image service (driver-selectable GD/Imagick), does proportional scaling to 300px, encodes PNG/JPEG, and ships the tms and ims validation rules. The 5.0.0 release is a hard modernisation cut — read the README upgrade section before touching anything else, because there is no in-place upgrade path from a pre-5 install.

Minimum steps for a new install:

  1. Confirm the environment: PHP 8.3+ and Laravel 13 only. Nothing older is supported, so check composer.json constraints and your CI matrix first — this is the most common reason installation silently resolves to an old version.
  2. composer require the package, then do not register Intervention Image's own ImageServiceProvider. 5.0.0 fixes a binding conflict with Laravel 13's image service; registering the upstream provider manually re-introduces the collision.
  3. Publish/verify config for the driver (gd vs imagick). Confirm ext-gd or ext-imagick is actually present on every environment — including the queue workers, since image work is usually dispatched.
  4. First use case: a single upload endpoint. Put ims/tms in a Form Request, let the service do the 300px proportional resize, and assert the resulting MIME type is image/png or image/jpeg.

The fastest sanity check on a fresh checkout is a cold-boot request, not a unit test — the two bugs fixed in this release (unregistered rules on first use, provider binding) only surfaced in a genuine cold start.

Implementation Patterns

Validate with the shipped rules, in Form Requests. tms and ims are the package's own rules; keep them in a Form Request rather than the controller so the failure messages stay consistent across upload endpoints. Because 5.0.0 fixes first-use registration, you can now reference the rule string directly without a warm-up request or a manual Validator::extend call.

Resolve the image service from the container, don't instantiate it. The whole point of the 5.0.0 binding fix is that the driver choice comes from config through the container. Injecting the service (or a facade) keeps GD/Imagick swappable per environment — GD locally, Imagick in production if you need better resampling quality or format coverage.

Treat 300px as a default, not a constant. The proportional scaling to 300px is retained behaviour, but different upload surfaces (avatar vs. cover image vs. thumbnail) rarely want the same edge. Wrap the package call in a small application-level ImageUploader/action class so a future size change is one file, not a grep across controllers.

Pipeline shape: validate in Form Request → move to a temp/tmp disk → hand the path to the image service → store the encoded result on the public/private disk → persist the path. Keep the originating upload and the derived image separate; you will want to re-derive at a different size later without re-uploading.

Test both drivers in CI. The release notes confirm GD and Imagick are both covered by the suite. Mirror that: a matrix leg per driver catches the classic "works on GD, colour-shifts or fails on Imagick" class of bug, especially with palette PNGs and transparency. If a full matrix is too slow, at minimum run Imagick on the branch that touches image code.

Config caching. Run php artisan config:cache in the deploy step like any Laravel package, but be aware the driver is read from config — a stale cached config after switching extensions is a five-minute debugging session you don't need.

Gotchas and Tips

  • Intervention Image 2 → 4 is the real migration cost. If your application calls the old Image API directly (not through this package), those call sites need rewriting. v4 changed method signatures, the manager/instantiation model, and encoder handling. Grep for Intervention\Image and Image::make( before you start; that list is your migration estimate.
  • Remove the old ImageServiceProvider registration. Both a stale entry in config/app.php and a leftover entry in bootstrap/providers.php will bite you in Laravel 13. If you see "target class does not exist" or a double-bound image service, look here first.
  • "Rules not registered on first use" was a cold-start bug. It's fixed, but if you're debugging a rule that only fails on the first request after a deploy, reproduce it with an empty cache and a fresh PHP-FPM worker rather than in a warm test process — this is exactly how the maintainers found it.
  • Output formats are PNG and JPEG only per this release. No WebP/AVIF. If you need modern formats, transcode downstream or open an issue — don't assume passing a .webp source will be honoured; it will be re-encoded to one of the two.
  • Imagick memory. A 300px resize still decodes the full-size original. Large phone photos hitting a low memory_limit on a queue worker is the most likely production failure mode; set the limit per-worker rather than raising it globally.
  • Laravel 13-only means no shared support window. Any app still on 10/11/12 cannot use 5.0.0 and is stuck on the 4.x line. Plan the framework upgrade first, package upgrade second — doing it in the same branch makes bisecting failures near-impossible.
  • Extension points to prefer: the container binding (for driver swaps in tests) and a thin application-level wrapper around the resize/encode call. Reach for those before forking; the release cadence here is aggressive, and a fork will be painful at the next major.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator