Weave Code
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

Shariff Laravel Package

heise/shariff

PHP backend for Shariff that fetches social share counts without client-side requests to social networks. Supports Buffer, Facebook, Pinterest, Reddit, Xing, VK and more, with domain whitelisting and configurable caching (filesystem or Laminas adapters).

View on GitHub
Deep Wiki
Context7

👮 PHP backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.

Frequently asked questions about Shariff
How do I install Shariff in a Laravel project?
Run `composer require heise/shariff` and configure it via a `config/shariff.php` file. Bind the backend to Laravel’s service container in `AppServiceProvider` and expose counts via a controller or API route.
Does Shariff work with Laravel’s caching system?
Yes, replace the default Laminas Cache with Laravel’s Cache facade (e.g., Redis or FileCache) by implementing a custom `CacheInterface` adapter. The package supports Laravel’s built-in caching drivers.
Which Laravel versions support Shariff?
Shariff requires PHP 8.1+, so it’s compatible with Laravel 10.x and 11.x. Test thoroughly if using newer PHP versions (8.3/8.4) with Laravel’s latest LTS releases.
How do I restrict Shariff to specific domains?
Define allowed domains in `config/shariff.php` under the `domains` key. If empty, all domains are permitted. This is useful for GDPR compliance and security.
Can I use Shariff asynchronously for better performance?
Yes, leverage Laravel’s queue system to refresh share counts asynchronously. Set a longer cache TTL (e.g., 5 minutes) and dispatch a job to update counts periodically.
What happens if Facebook’s API changes or goes down?
Shariff relies on Facebook’s Graph API (v25.0). Monitor deprecation notices and implement fallback logic (e.g., cached values or graceful degradation). Laravel’s monitoring tools like Sentry can log failures.
Is Shariff secure for public-facing endpoints?
The backend endpoint (`/shariff-backend`) should be rate-limited or authenticated if exposed publicly. Use Laravel’s middleware (e.g., `throttle`) to prevent abuse.
How do I customize Shariff for additional social platforms?
Extend the package by implementing new service classes for unsupported platforms (e.g., email shares). Follow the existing service pattern and register them in `config/shariff.php`.
Can I deploy Shariff standalone or must it run inside Laravel?
Shariff can run standalone (via `index.php`) or integrate into Laravel. For privacy compliance, standalone deployment may be preferable to avoid mixing analytics with app logic.
How do I handle caching for high-traffic Laravel apps?
Use Laravel’s Redis or Memcached drivers for distributed caching. Adjust the cache TTL based on traffic (e.g., 60s for real-time needs, 5m for batch updates). Horizontal scaling is supported if cache is external.
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata