PHPackages                             revolution/laravel-mastodon-api - 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. revolution/laravel-mastodon-api

ActiveLibrary

revolution/laravel-mastodon-api
===============================

Mastodon API for Laravel

3.5.0(2mo ago)2669.5k↑219.2%22MITPHPPHP ^8.3CI passing

Since May 10Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/invokable/laravel-mastodon-api)[ Packagist](https://packagist.org/packages/revolution/laravel-mastodon-api)[ GitHub Sponsors](https://github.com/invokable)[ RSS](/packages/revolution-laravel-mastodon-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (43)Used By (2)

Mastodon API for Laravel
========================

[](#mastodon-api-for-laravel)

[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/invokable/laravel-mastodon-api)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Laravel &gt;= 12.0

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

[](#installation)

### Composer

[](#composer)

```
composer require revolution/laravel-mastodon-api

```

[Socialite](https://github.com/invokable/socialite-mastodon) and [Notification](https://github.com/invokable/laravel-notification-mastodon) packages will also be installed.

Usage
-----

[](#usage)

### Registering an application

[](#registering-an-application)

#### By Web UI

[](#by-web-ui)

1. Go to your Mastodon's user preferences page.
2. Go to development page.

#### By API

[](#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

[](#oauth-authentication)

Use

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

### Get statuses

[](#get-statuses)

```
use Revolution\Mastodon\Facades\Mastodon;

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

dd($statuses);
```

### Get one status

[](#get-one-status)

```
use Revolution\Mastodon\Facades\Mastodon;

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

dd($status);
```

### Post 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

[](#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

[](#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

[](#other-methods)

Check public methods in `Contracts/Factory.php`

Streaming API
-------------

[](#streaming-api)

Edit `$token` and `$url` in streaming\_example.php

```
php ./streaming_example.php

```

`Ctrl+C` to quit.

LICENSE
-------

[](#license)

MIT

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~80 days

Recently: every ~91 days

Total

41

Last Release

86d ago

Major Versions

1.5.2 → 2.0.02019-02-27

1.x-dev → 2.0.12019-07-25

2.x-dev → 3.0.02023-01-28

PHP version history (8 changes)1.0.0PHP &gt;=7.0.0

2.0.0PHP &gt;=7.1.3

2.1.0PHP ^7.2||^8.0

2.4.0PHP ^7.3||^8.0

3.0.0PHP ^8.0

3.1.0PHP ^8.1

3.2.0PHP ^8.2

3.5.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77618633?v=4)[Revolution](/maintainers/revolution)[@Revolution](https://github.com/Revolution)

---

Top Contributors

[![kawax](https://avatars.githubusercontent.com/u/1502086?v=4)](https://github.com/kawax "kawax (95 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")[![devin-ai-integration[bot]](https://avatars.githubusercontent.com/in/811515?v=4)](https://github.com/devin-ai-integration[bot] "devin-ai-integration[bot] (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

mastodonlaravelmastodon

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/revolution-laravel-mastodon-api/health.svg)

```
[![Health](https://phpackages.com/badges/revolution-laravel-mastodon-api/health.svg)](https://phpackages.com/packages/revolution-laravel-mastodon-api)
```

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
