{"id":18794573,"url":"https://github.com/effectra/link","last_synced_at":"2025-12-29T19:30:13.929Z","repository":{"id":167247659,"uuid":"642843969","full_name":"effectra/link","owner":"effectra","description":"\"Effectra\\Link: PHP library for working with hypermedia links, evolvable links, and link management. Enhance your RESTful APIs with easy link creation and retrieval.\"","archived":false,"fork":false,"pushed_at":"2023-06-19T17:11:13.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-01-22T13:02:07.180Z","etag":null,"topics":["hyperlink","link","php","psr","psr-13"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effectra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-19T13:23:58.000Z","updated_at":"2024-01-22T13:02:07.181Z","dependencies_parsed_at":null,"dependency_job_id":"f60f2d7f-d9b7-4bb9-b2b7-5df14140c35d","html_url":"https://github.com/effectra/link","commit_stats":null,"previous_names":["effectra/link"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Flink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Flink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Flink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Flink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effectra","download_url":"https://codeload.github.com/effectra/link/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718733,"owners_count":19685806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hyperlink","link","php","psr","psr-13"],"created_at":"2024-11-07T21:29:49.211Z","updated_at":"2025-12-29T19:30:13.882Z","avatar_url":"https://github.com/effectra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effectra/Link\n\nEffectra\\Link is a PHP library that provides implementations of various PSR link interfaces. It offers classes such as Link, EvolvableLink, and LinkProvider, which enable you to work with hypermedia links, manage evolvable links, and retrieve links for your applications.\n\n## Features\n\n- Create and manipulate hypermedia links\n- Manage evolvable links\n- Retrieve links by relation\n- Generate HTML string with links\n\n## Requirements\n\n- PHP 7.4 or higher\n\n## Installation\n\nYou can install the Effectra\\Link package via Composer. Simply run the following command:\n\n```bash\ncomposer require effectra/link\n```\n\n## Usage\n\n### Creating a Link\n\n```php\nuse Effectra\\Link\\Link;\n\n$link = new Link('http://example.com', false, ['rel' =\u003e 'self'], ['title' =\u003e 'Example Link']);\n```\n\n### Manipulating a Link\n\n```php\n// Add a relation to the link\n$link = $link-\u003ewithRel('next');\n\n// Remove a relation from the link\n$link = $link-\u003ewithoutRel('self');\n\n// Add an attribute to the link\n$link = $link-\u003ewithAttribute('class', 'link-class');\n\n// Remove an attribute from the link\n$link = $link-\u003ewithoutAttribute('title');\n```\n\n### Retrieving Links\n\n```php\nuse Effectra\\Link\\LinkProvider;\n\n$link1 = new Link('http://example.com', false, ['rel' =\u003e 'self']);\n$link2 = new Link('http://example.com/posts', false, ['rel' =\u003e 'collection']);\n\n$links = [$link1, $link2];\n\n$linkProvider = new LinkProvider($links, []);\n\n$allLinks = $linkProvider-\u003egetLinks(); // Returns an array of LinkInterface objects\n\n$collectionLinks = $linkProvider-\u003egetLinksByRel('collection'); // Returns an array of EvolvableLinkInterface objects with the 'collection' relation\n```\n\n### Generating HTML with Links\n\n```php\n$html = $linkProvider-\u003ewithHTML($links); // Generates an HTML string with links\n```\n\nFor more information and advanced usage, please refer to the documentation.\n\n## Contributing\n\nContributions are welcome! If you have any bug reports, feature requests, or suggestions, please open an issue on the GitHub repository.\n\n## License\n\nEffectra\\Link is open-source software licensed under the MIT license. See the [LICENSE](LICENSE) file for more information.\n```\n\nFeel free to customize the content to fit your specific needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Flink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffectra%2Flink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Flink/lists"}