{"id":37366080,"url":"https://github.com/imliam/shareable-link","last_synced_at":"2026-01-16T04:52:27.876Z","repository":{"id":32654427,"uuid":"138933499","full_name":"imliam/shareable-link","owner":"imliam","description":"Conveniently generate shareable URLs for various social media websites.","archived":false,"fork":false,"pushed_at":"2025-03-09T16:41:07.000Z","size":11,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T08:22:38.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://medium.com/@liamhammett/php-shareable-social-media-links-d859f5dd5006","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imliam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-27T21:11:20.000Z","updated_at":"2025-03-09T16:40:52.000Z","dependencies_parsed_at":"2022-08-07T17:47:41.999Z","dependency_job_id":null,"html_url":"https://github.com/imliam/shareable-link","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/imliam/shareable-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imliam%2Fshareable-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imliam%2Fshareable-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imliam%2Fshareable-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imliam%2Fshareable-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imliam","download_url":"https://codeload.github.com/imliam/shareable-link/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imliam%2Fshareable-link/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T04:52:26.325Z","updated_at":"2026-01-16T04:52:27.871Z","avatar_url":"https://github.com/imliam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shareable Links\n\n## Introduction\n\nConveniently generate shareable URLs for a variety of different social media websites, using the syntax each uses for their own links.\n\n## Installation\n\nYou can install this package with Composer using the following command:\n\n```bash\ncomposer require imliam/shareable-link:^1.0.0\n```\n\n## Example Usage\n\n```php\n$url = new \\ImLiam\\ShareableLink('http://example.com/', 'Example Site');\n\n// Alternatively, with the helper function:\n// shareable_link('http://example.com/', 'Example Site');\n\necho $url-\u003efacebook;\n// https://www.facebook.com/dialog/share?app_id=ABC123\u0026href=https://example.com/\u0026display=page\u0026title=Example+Site\n\necho $url-\u003etwitter;\n// https://twitter.com/intent/tweet?url=https://example.com/\u0026text=Example+Site\n\necho $url-\u003ewhatsapp;\n// https://wa.me/?text=Example+Site+https%3A%2F%2Fexample.com%2F\n\necho $url-\u003elinkedin;\n// https://www.linkedin.com/shareArticle?mini=true\u0026url=https://example.com/\u0026summary=Example+Site\n\necho $url-\u003epinterest;\n// https://pinterest.com/pin/create/button/?media=\u0026url=https://example.com/\u0026description=Example+Site\n\necho $url-\u003egoogle;\n// https://plus.google.com/share?url=https://example.com/\n```\n\n## Facebook Link Notes\n\nA link shareable through Facebook requires an app ID from the platform. By default, this will attempt to be obtained through a `FACEBOOK_APP_ID` environment variable. However, if this environment variable does not exist, or you need to pass through different app IDs for different URLs, you can pass one through explicitly to the `getFacebookUrl()` method.\n\n```php\n$url = new \\ImLiam\\ShareableLink('http://example.com/', 'Example Site');\n\nputenv('FACEBOOK_APP_ID=ABC123');\n\necho $url-\u003efacebook;\n// https://www.facebook.com/dialog/share?app_id=ABC123\u0026href=https://example.com/\u0026display=page\u0026title=Example+Site\n\necho $url-\u003egetFacebookUrl('XYZ789');\n// https://www.facebook.com/dialog/share?app_id=XYZ789\u0026href=https://example.com/\u0026display=page\u0026title=Example+Site\n```\n\n## Laravel Model Trait\n\nIf you're using Laravel and want to be able to use these methods directly from an Eloquent model as a convenient method, you can simply create one.\n\nThe advantage of this is that you get full control over the URL and title you want to be used while still keeping a fluent syntax.\n\n```php\nclass News extends Model\n{\n    public function getShareUrlAttribute(): \\ImLiam\\ShareableLink\n    {\n        $url = route('news.show', $this-\u003eslug);\n\n        return new \\ImLiam\\ShareableLink($url, $this-\u003etitle);\n    }\n}\n```\n\nYou can then proceed to use the pseudo-attribute method as you would use the normal class.\n\n```php\n$news-\u003eshare_url-\u003etwitter;\n```\n\n## Credits\n\n- [Denis Smink](https://dennissmink.nl/) for the [original article](https://medium.com/@dennissmink/laravel-shareable-trait-1a6b12a05094) that prompted this\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimliam%2Fshareable-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimliam%2Fshareable-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimliam%2Fshareable-link/lists"}