A Laravel package to create an ActivityPub webfinger.

1.1.0 2023-02-12 15:06 UTC

This package is auto-updated.

Last update: 2023-03-16 21:04:09 UTC


This creates a webfinger, 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.


You can install the package via composer:

composer require surface/laravel-webfinger

You must add the configuration to your .env file:


You can publish the config file with:

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

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;

    static fn (Container $app): WebfingerResource => new WebfingerResource(

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


namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Support\Stringable;
use Surface\LaravelWebfinger\Http\Resources\Webfinger as JsonResource;

class Webfinger extends JsonResource
    protected string $website;

    public function __construct(protected Stringable $instance, protected Stringable $username)
        parent::__construct($instance, $username);

        $this->website = '';

    public function links(Request $request): array
        return [
                'rel' => 'self',
                'type' => 'text/html',
                'href' => $this->website,


composer test


Please see CHANGELOG for more information on what has changed recently.



The MIT License (MIT). Please see License File for more information.