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 Bundle Laravel Package

core23/shariff-bundle

View on GitHub
Deep Wiki
Context7

NucleosShariffBundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Continuous Integration Code Coverage Type Coverage

This bundle provides a wrapper for using shariff inside the symfony sonata-project.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require nucleos/shariff-bundle

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    Nucleos\ShariffBundle\NucleosShariffBundle::class => ['all' => true],
];

Define cache, http client and request factory:

# config/routes/nucleos_shariff.yaml

framework:
    cache:
        pools:
            cache.shariff:
                adapter: cache.adapter.filesystem

nucleos_shariff:
    cache: 'cache.shariff'
    http_client: 'some.http.client'         # e.g httplug.client
    request_factory: 'some.request.factory' # e.g. nyholm.psr7.psr17_factory

Assets

It is recommended to use webpack / webpack-encore to include the shariff.js and shariff.css file in your page.

You can use npm or yarn to load the library:

npm install shariff
yarn add shariff

Configure the Bundle

Create a configuration file called nucleos_shariff.yaml:

# config/routes/nucleos_shariff.yaml

nucleos_shariff:
    resource: "@NucleosShariffBundle/Resources/config/routing/backend.yml"

Create a configuration file called framework_cache.yaml:

framework:
    cache:
        pools:
            cache.shariff:
                adapter: cache.adapter.filesystem

Usage

{# template.twig #}

{{ sonata_block_render({ 'type': 'nucleos_shariff.block.share' }, {
    'url': 'https://example.com/site.html'
}) }}

Configure the Bundle

You can globally configure the services that should count the likes or favorites for a page.

nucleos_shariff:
    cache: 'cache.shariff'
    http_client: 'some.http.client'
    request_factory: 'some.request.factory'

    options:
        domains: [ ] # Allow specific domains for shariff
        services: [ 'addthis', 'buffer', 'facebook', 'pinterest', 'reddit', 'stumbleupon', 'vk', 'xing' ]

    services:
        facebook:
            app_id:  "1234567890"
            secret:  "GENERATEDSECRET"
            version: "5.0"

This is a fork of shariff-php with a more modern and dynamic solution.

License

This bundle is under the MIT license.

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle