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 Ali Green Laravel Package

james.xue/laravel-ali-green

A Laravel wrapper for Alibaba Cloud Green (Ali Green) adding automated content moderation. Scan text, images, and media for risky or prohibited content through a clean API with facade support, so compliance checks on user-generated content are simple without touching the raw SDK.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a thin Laravel adapter, not an engine: a ServiceProvider, facade, and publishable config that wrap Alibaba Cloud's Green (内容安全) content-moderation API. All detection — text anti-spam/keyword, image porn/terrorism/ads/QR-code, video pornography and political-violence categories — happens server-side at Aliyun. The package's only value is ergonomics (idiomatic Laravel config, facades, exception handling), so it is easily replicated and must be judged on wrapper quality, not capability.

Integration feasibility. Mechanically low-friction: composer require, publish config, add AccessKey ID/Secret to .env, call the facade. The real integration cost sits outside the code — Aliyun account provisioning, real-name verification, RAM least-privilege sub-account, region selection, and endpoint egress. Budget that as the dominant task.

Technical risk.

  • Staleness. Last release July 2023. Aliyun has since shifted toward newer Green API versions / green-cip endpoints; a wrapper pinned to an older version may be deprecated or missing categories.
  • No field validation. Zero dependents and 63 stars means effectively no production evidence. Treat as unproven until spiked.
  • Bus factor of one. Single maintainer, Chinese-only documentation, unclear CI/test coverage.
  • Async video is the hard part. Video moderation is submit-then-callback/poll; wrappers frequently handle this poorly (no idempotency, no reconciliation, no polling helper).
  • Credential hygiene. Verify the package does not log or serialize access keys in exceptions.
  • Version drift. Laravel 11/12 and PHP 8.3 support are unlikely to be declared and must be checked.

Key questions to answer in a spike.

  1. Which Aliyun Green API version/endpoint does it target, and is that version still supported?
  2. Does it implement async video submit + callback handling + status polling, or only synchronous calls?
  3. Is the endpoint/region configurable (multi-region, green-cip vs legacy green)?
  4. Does it surface Aliyun rate-limit (QPS) and error codes distinctly enough to drive retry/backoff?
  5. What are its illuminate/* and PHP constraints? Any tests?
  6. Does it cover the specific categories we need (custom keyword libraries, ad detection, custom image libraries)?
  7. Is credential redaction handled in logs and exception messages?

Integration Approach

Stack fit. Written for the Laravel 8–10 / PHP 7.4–8.1 era. If we are on Laravel 11+, plan on either a fork with widened constraints or vendoring the code. There is no meaningful upstream to wait on.

Migration path. Do not let the package leak into call sites. Define our own ContentModerator contract with methods for text, image, and video-submission, and implement it with this package behind it. That makes the package an implementation detail we can replace with Alibaba's official alibabacloud/green SDK, a competing vendor (Tencent, Volcano, self-hosted), or an in-house client without touching product code. Given the maturity signals, the realistic posture is: use the package as a reference implementation to fork and own, not as a dependency of record.

Compatibility prerequisites. Verified Aliyun account; RAM sub-account scoped to Green only; chosen region confirmed against where our users and data sit; outbound network path to Aliyun endpoints; and, if deploying outside mainland China, an explicit review of cross-border data transfer and content-residency obligations before user content is shipped to Aliyun.

Sequencing.

  1. Credentials + text moderation smoke test in a sandbox; confirm the API version is live.
  2. Image moderation against a hand-labeled sample set — measure false-positive and false-negative rates, not just "it returns a response."
  3. Choose blocking thresholds and category policy (this is product work, and it usually takes longer than the code).
  4. Build the async video pipeline: submit, callback endpoint, idempotent persistence, reconciliation job for stuck items, dead-letter queue.
  5. Wrap in a domain service with metrics, timeouts, circuit breaker, and a fail-open/fail-closed decision per surface.
  6. Roll out behind a feature flag; run moderation in advisory (log-only) mode before it blocks anything.

Operational Impact

Maintenance. Expect to own this. No releases in ~18 months, one maintainer, no dependents. MIT means forking is legally trivial — do it early, pin the fork internally, and track Aliyun API deprecation notices yourself. Allocate a small recurring maintenance budget rather than assuming upstream will absorb changes.

Support. The escalation path is Aliyun support tickets, not the package author. Documentation is Chinese-first and GitHub issue traffic is thin at this star count. Ensure someone on the team reads Chinese, or contract for translation of the Aliyun Green API docs — those, not the package README, will be the real reference during incidents.

Scaling. Throughput is bounded by the Aliyun account's QPS quotas and tier, not by PHP. Costs are per-call and volume-driven; image and especially video moderation carry real per-unit pricing — model cost against content volume before committing, and cache on content hash for repeats. Async video requires queue capacity plus a callback receiver sized for spikes, and a worker pool independent of request workers.

Failure modes to design for.

  • Synchronous text/image timeouts: decide fail-open vs fail-closed per surface (fail-open on comments, fail-closed on avatar uploads, for example) and make that explicit in code and in product requirements.
  • Access-key expiry or rotation causing silent 403s — alert on auth-error rate, not just on exceptions.
  • Lost video callbacks leaving content permanently "pending" — reconciliation sweep is mandatory.
  • False positives blocking legitimate users — need an appeal path and a human review queue; moderation accuracy is a product surface, not just an API call.
  • API version deprecation without a package update — monitor and be ready to patch the fork.
  • Compliance exposure: shipping user content to a Chinese cloud provider may trigger data-residency and disclosure obligations depending on our user base.

Ramp-up. A Laravel developer reaches working text + image moderation in roughly 1–2 days, most of it Aliyun account setup. The async video pipeline — callback endpoint, idempotency, retries, reconciliation — adds 3–5 days. Policy tuning (thresholds, category selection, appeal workflow) is the largest uncounted effort and should be scheduled as product work with the trust-and-safety owner, not folded into the engineering estimate.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route