- How do I install chencha/share in a Laravel application?
- Install it with composer require chencha/share. The package uses Laravel package auto-discovery to register its service provider and facade, and you can optionally publish its config file. Before adopting it, verify the Composer constraints against your Laravel and PHP versions.
- Which Laravel and PHP versions does chencha/share support?
- The last tagged release is 2022-03-31, so compatibility with current Laravel 10, 11, or 12 and PHP 8.2+ should not be assumed. Check the composer.json constraints and run the package tests on your target runtime. Treat version support as something to verify in a spike, not as a documented guarantee.
- How do I create a Facebook or Twitter/X share link with chencha/share?
- Use the package's fluent API to pass the page URL, title, and optional image, then generate the platform-specific share URL for Facebook, Twitter/X, LinkedIn, or another supported network. Output that URL as a normal link in your Blade view so the user's browser opens the platform's share dialog. Verify each generated URL against the platform's current share documentation because templates can drift.
- Can I customize the share URL templates without forking the package?
- The package exposes a publishable config file, so the first step is to publish it and inspect whether each platform's share URL template is defined there and overridable. If a template is not config-driven, wrap the package behind your own service or fork/vendor it for that platform. Keep the published config in version control so template changes are reviewed as code.
- Does chencha/share work without JavaScript?
- Yes. chencha/share only assembles outbound share URLs on the server; it does not require JavaScript to build the link. The share dialog opens only after the user clicks the generated link, and based on its URL-generator design it does not need to inject third-party JavaScript or tracking pixels to work.
- How do I add social share buttons in a Blade template?
- Render the generated share URL in a Blade template using the package's Blade directive, facade, or helper, or wrap it in your own Blade component. Keep the package call behind that component or a small ShareLinkService so views do not depend on the package directly. Add accessible link text and icons for each platform.
- Can I add UTM parameters or analytics to share links with chencha/share?
- The package itself does not provide analytics or UTM attribution for share links. You can append UTM parameters to the URL you pass into the generator or add them in a first-party wrapper before rendering. Test the final links because some platforms may rewrite or ignore query parameters.
- Is chencha/share safe for production use?
- Treat it as a low-risk but low-battle-testing dependency: it has a shallow integration surface and no database or request-pipeline impact, but the last release is from 2022 and adoption is limited. Broken share links fail silently in the browser, so monitoring will not alert you. Wrap it behind your own service or Blade component, validate target platform URLs, and have a fork, vendor, or replace plan.
- How do I test that chencha/share generated links are correct?
- Write tests around your wrapper to assert the generated URL for each platform, including encoded titles, URLs, ampersands, query strings, and non-ASCII text. Compare the output against each platform's current share documentation during a spike. Since broken links fail in the browser, add periodic link checks rather than relying on server-side exceptions.
- What should I do if chencha/share is unmaintained or incompatible with my Laravel version?
- Keep chencha/share behind a first-party ShareLinkService or Blade component so you have a one-file swap point. If it is unmaintained or incompatible, you can vendor the URL templates, fork and patch a single platform, or replace it with a small first-party helper. Publish and commit the config so any template overrides remain reviewable.