New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

revolution/laravel-mastodon-api

Mastodon API for Laravel
96,529 27

Larablocks Analysis

revolution/laravel-mastodon-api works with Laravel 12 and 13 (latest release 3.5.0, Feb 21, 2026).

Laravel 4 to 11 in earlier releases.

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Feb 21, 2026)
  • 3,070 downloads a month (needs 10,000)
  • 27 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Feb 21, 2026.
  • 1 release in the last 12 months.
  • First released: May 10, 2017.
  • Monthly downloads: 3,070, down 16% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require revolution/laravel-mastodon-api
Latest Version:3.5.0
PHP:^8.3
Laravel:12 · 13
Older releases:4 – 11
License:MIT
Last Updated:Jun 20, 2026
Links: GitHub  ·  Packagist
Maintainer: revolution

Mastodon API for Laravel

Ask DeepWiki

Requirements

  • PHP >= 8.3
  • Laravel >= 12.0

Installation

Composer

composer require revolution/laravel-mastodon-api

Socialite and Notification packages will also be installed.

Usage

Registering an application

By Web UI
  1. Go to your Mastodon's user preferences page.
  2. Go to development page.
By API
use Revolution\Mastodon\Facades\Mastodon;

class MastodonController
{
    public function app()
    {
        $client_name = 'my-app';
        $redirect_uris = 'https://my-instance/callback';
        $scopes = 'read write follow';
        
        $app_info = Mastodon::domain('https://example.com')
                            ->createApp($client_name, $redirect_uris, $scopes);

        dd($app_info);
        //[
        //    'id' => '',
        //    'client_id' => '',
        //    'client_secret' => '',
        //]
     }
}

OAuth authentication

Use https://github.com/invokable/socialite-mastodon

Save account info.(id, token, username, acct...and more.)

Get statuses

use Revolution\Mastodon\Facades\Mastodon;

$statuses = Mastodon::domain('https://example.com')
                    ->token('token')
                    ->statuses($account_id);

dd($statuses);

Get one status

use Revolution\Mastodon\Facades\Mastodon;

$status = Mastodon::domain('https://example.com')
                  ->token('token')
                  ->status($status_id);

dd($status);

Post status

use Revolution\Mastodon\Facades\Mastodon;

Mastodon::domain('https://example.com')->token('token');
$response = Mastodon::createStatus('test1');
$response = Mastodon::createStatus('test2', ['visibility' => 'unlisted']);

dd($response);

Any API by get or post method

use Revolution\Mastodon\Facades\Mastodon;

$response = Mastodon::domain('https://example.com')
                    ->token('token')
                    ->get('/timelines/public', ['local' => true]);
use Revolution\Mastodon\Facades\Mastodon;

$response = Mastodon::domain('https://example.com')
                    ->token('token')
                    ->post('/follows', ['uri' => '']);

Any API can call by call method

use Revolution\Mastodon\Facades\Mastodon;

$response = Mastodon::domain('https://example.com')
                    ->token('token')
                    ->call('DELETE', '/statuses/1');

Other methods

Check public methods in Contracts/Factory.php

Streaming API

Edit $token and $url in streaming_example.php

php ./streaming_example.php

Ctrl+C to quit.

LICENSE

MIT

Related Packages

revolution/socialite-mastodon

Socialite for Mastodon

322,076 13
surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

4,752 14
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440

Version History

Version Released PHP Laravel License
3.5.0 ^8.3 ^12.0||^13.0 MIT
3.4.0 ^8.2 ^11.0||^12.0 MIT
3.3.2 ^8.2 ^11.0||^12.0 MIT
3.3.1 ^8.2 ^11.0||^12.0 MIT
3.3.0 ^8.2 ^11.0||^12.0 MIT