Download the PHP package beziworld/laravel-opinions without Composer
On this page you can find all versions of the php package beziworld/laravel-opinions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-opinions
More information about beziworld/laravel-opinions
Files in beziworld/laravel-opinions
Package laravel-opinions
Short Description Customer review services for Laravel: Trusted Shops (eTrusted) invitations, reviews and cached ratings, Ceneo Zaufane Opinie transaction script, unified data objects and a rating badge.
License MIT
Homepage https://github.com/beziworld/laravel-opinions
Informations about the package laravel-opinions
Laravel Opinions
Customer review services for Laravel shops behind one driver API:
- Trusted Shops (eTrusted API): review invitations after an order, reviews of the shop and its products, aggregated rating
- Ceneo Zaufane Opinie: the transaction script for the order confirmation page, which makes Ceneo e-mail its review survey
- unified data objects:
Invitation,Review,ReviewPage,Rating - queued invitations (
SendReviewInvitation, never retried automatically) withInvitationSentandInvitationFailedevents - cached ratings with a stale-on-error fallback, a scheduler command and a
<x-opinions::rating-badge />Blade component (English and Polish) - many shops (brands, store fronts, tenants), runtime credentials and custom drivers with
Opinions::extend()
Polska wersja dokumentacji
Supported services
| Service | Invitations | Reviews | Rating | Browser script |
|---|---|---|---|---|
Trusted Shops (trustedshops) |
yes, POST /events |
yes, GET /reviews |
yes, channel aggregate | no |
Ceneo Zaufane Opinie (ceneo) |
no server API | no API | no API | yes |
| Opineo | not included | not included | not included | not included |
Ceneo's public API (Swagger) covers offers, bidding and orders but
has no methods for reviews or surveys; Zaufane Opinie works through a script on the order confirmation page. Opineo
publishes no API documentation (integration instructions are available only in the Opineo business panel), so the
package ships no Opineo driver. If you have the instructions, register your own driver with Opinions::extend().
Why this package
Existing PHP packages cover one service each: antistatique/trustedshops-php-sdk targets the legacy Trusted Shops
API that Trusted Shops now marks as outdated, Ceneo and Opineo packages are Magento modules or small clients of
undocumented endpoints. This package uses the current eTrusted API, adds Laravel queues, caching, Blade components and
multi-shop configuration, and gives every service the same data objects.
Installation
Invitations after an order
Send invitations only to customers who opted in. Trusted Shops turns the event into an invitation according to the
questionnaire and schedule configured for the event type in eTrusted. Opinions::sendInvitation($invitation) sends
synchronously and returns InvitationResult objects (reference is the eTrusted evt-... id). Failed jobs dispatch
InvitationFailed and are not retried, so the customer never receives two invitations.
Ceneo Zaufane Opinie
The components render the loader https://ssl.ceneo.pl/ct/v5/script.js?accountGuid=... and the call
_ceneo('transaction', {client_email, order_id, shop_products, amount}), as described in the
Shoper integration guide; Ceneo's own instructions are available in the Ceneo
panel. Without consent the e-mail address is left empty. All values are JSON-encoded with HTML-safe escaping.
Reviews
Trusted Shops recommends hiding REJECTED reviews in custom widgets; ReviewQuery::approved() does that.
Rating badge
The badge shows stars, 4,8/5 and the number of reviews (Polish plural forms included) and renders nothing when
the shop has no reviews. Ratings are cached for OPINIONS_CACHE_TTL seconds (6 hours by default); when the service
fails, the last known rating is kept. Trusted Shops recommends the 365-day aggregate for public display, which is the
default (TRUSTEDSHOPS_RATING_PERIOD). Publish the views with --tag=opinions-views to change the markup.
Many shops
Errors
| Exception | When |
|---|---|
ApiException |
the service rejected the request or could not be reached: driver(), httpStatus(), payload(), isRateLimited(), retryAfter() |
UnsupportedOperation |
the driver's service does not offer the operation (e.g. reviews from Ceneo) |
InvalidConfiguration |
unknown shop or driver, missing credentials, invalid option |
All extend OpinionsException. Invitations are sent once; reviews and ratings are retried on connection errors and
HTTP 5xx (TRUSTEDSHOPS_RETRIES). An expired token is refreshed once after HTTP 401.
Development
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need an integration? Get in touch through beziworld.eu.
License
MIT. See LICENSE.md. This package is not affiliated with Trusted Shops, Ceneo or Opineo.
All versions of laravel-opinions with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/bus Version ^12.0|^13.0
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0