PHPackages                             surface/laravel-webfinger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. surface/laravel-webfinger

ActiveLibrary[API Development](/categories/api)

surface/laravel-webfinger
=========================

A Laravel package to create an ActivityPub webfinger.

v3.0.0(2mo ago)113.8k↓12.5%1MITPHPPHP ^8.2CI passing

Since Feb 12Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/trovster/laravel-webfinger)[ Packagist](https://packagist.org/packages/surface/laravel-webfinger)[ Docs](https://github.com/trovster/laravel-webfinger)[ RSS](/packages/surface-laravel-webfinger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (24)Versions (7)Used By (0)

Create a Webfinger in Laravel
=============================

[](#create-a-webfinger-in-laravel)

This creates a [webfinger](https://webfinger.net), a way to attach information to an email address, or an other online resource. Once installed you should see your JSON webfinger profile at `/.well-known/webfinger`.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require surface/laravel-webfinger
```

You must add the configuration to your `.env` file:

```
WEBFINGER_INSTANCE=mastodon.instance
WEBFINGER_USERNAME=your-username
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Surface\LaravelWebfinger\LaravelWebfingerServiceProvider"
```

Extending the Resource
----------------------

[](#extending-the-resource)

The resource which is converted to the JSON response is bound to the service container. This allows you to easily override the resource and add extra information. To change the binding, add the following to your app service provider.

```
use App\Http\Resources\Webfinger as WebfingerResource;
use Surface\LaravelWebfinger\Http\Resources\Webfinger as PackageWebfinger;
use Surface\LaravelWebfinger\Service\Webfinger as WebfingerService;

$this->app->bind(
    PackageWebfinger::class,
    static fn (Container $app): WebfingerResource => new WebfingerResource(
        ...$app->make(WebfingerService::class)
    )
);
```

Then you would create your custom resource which extends the base.

```
