{"id":15023024,"url":"https://github.com/trovster/laravel-webfinger","last_synced_at":"2025-09-01T02:40:52.672Z","repository":{"id":65823851,"uuid":"600725575","full_name":"trovster/laravel-webfinger","owner":"trovster","description":"A Laravel package to create an ActivityPub webfinger","archived":false,"fork":false,"pushed_at":"2024-03-12T18:16:43.000Z","size":35,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-06T21:05:28.528Z","etag":null,"topics":["activitypub","json","laravel","mastodon","php","social-web","webfinger"],"latest_commit_sha":null,"homepage":"","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/trovster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-02-12T12:07:25.000Z","updated_at":"2024-11-14T14:21:03.000Z","dependencies_parsed_at":"2023-02-28T05:45:41.814Z","dependency_job_id":"fd9518c1-c802-4dc6-9a4f-bac0f42562ee","html_url":"https://github.com/trovster/laravel-webfinger","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":"0.19999999999999996","last_synced_commit":"e24d89b9305235d1a3a0a3f103bee1430cf7b486"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trovster%2Flaravel-webfinger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trovster%2Flaravel-webfinger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trovster%2Flaravel-webfinger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trovster%2Flaravel-webfinger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trovster","download_url":"https://codeload.github.com/trovster/laravel-webfinger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238065141,"owners_count":19410587,"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":["activitypub","json","laravel","mastodon","php","social-web","webfinger"],"created_at":"2024-09-24T19:58:38.964Z","updated_at":"2025-02-10T05:31:15.947Z","avatar_url":"https://github.com/trovster.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Create a Webfinger in Laravel\n\nThis creates a [webfinger](https://webfinger.net), a way to attach information\nto an email address, or an other online resource. Once installed you should see\nyour JSON webfinger profile at `/.well-known/webfinger`.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require surface/laravel-webfinger\n```\n\nYou must add the configuration to your `.env` file:\n\n```bash\nWEBFINGER_INSTANCE=mastodon.instance\nWEBFINGER_USERNAME=your-username\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --provider=\"Surface\\LaravelWebfinger\\LaravelWebfingerServiceProvider\"\n```\n\n## Extending the Resource\n\nThe resource which is converted to the JSON response is bound to the service\ncontainer. This allows you to easily override the resource and add extra\ninformation. To change the binding, add the following to your app service\nprovider.\n\n```php\nuse App\\Http\\Resources\\Webfinger as WebfingerResource;\nuse Surface\\LaravelWebfinger\\Http\\Resources\\Webfinger as PackageWebfinger;\nuse Surface\\LaravelWebfinger\\Service\\Webfinger as WebfingerService;\n\n$this-\u003eapp-\u003ebind(\n    PackageWebfinger::class,\n    static fn (Container $app): WebfingerResource =\u003e new WebfingerResource(\n        ...$app-\u003emake(WebfingerService::class)\n    )\n);\n```\n\nThen you would create your custom resource which extends the base.\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Resources;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Stringable;\nuse Surface\\LaravelWebfinger\\Http\\Resources\\Webfinger as JsonResource;\n\nclass Webfinger extends JsonResource\n{\n    protected string $website;\n\n    public function __construct(protected Stringable $instance, protected Stringable $username)\n    {\n        parent::__construct($instance, $username);\n\n        $this-\u003ewebsite = 'https://www.example.com';\n    }\n\n    public function links(Request $request): array\n    {\n        return [\n            ...parent::links($request),\n            [\n                'rel' =\u003e 'self',\n                'type' =\u003e 'text/html',\n                'href' =\u003e $this-\u003ewebsite,\n            ],\n        ];\n    }\n}\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed\nrecently.\n\n## Credits\n\n- [Trevor Morris](https://github.com/trovster)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more\ninformation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrovster%2Flaravel-webfinger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrovster%2Flaravel-webfinger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrovster%2Flaravel-webfinger/lists"}