PHPackages                             starcitizenwiki/mediawikiapi - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. starcitizenwiki/mediawikiapi

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

starcitizenwiki/mediawikiapi
============================

Laravel Package to interact with a Mediawiki Installation through the API, authenticated via OAuth

1.0.3(2y ago)61.4kPHPPHP &gt;=7.4CI failing

Since Nov 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/StarCitizenWiki/LaravelMediawikiApi)[ Packagist](https://packagist.org/packages/starcitizenwiki/mediawikiapi)[ RSS](/packages/starcitizenwiki-mediawikiapi/feed)WikiDiscussions develop Synced today

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Laravel MediaWiki API
=====================

[](#laravel-mediawiki-api)

 [![packagist version](https://camo.githubusercontent.com/9fb5bd688326db2a9ab9200e5719fd06210bf1e916687420678b51c0f0e161ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746172636974697a656e77696b692f6d6564696177696b69617069)](https://camo.githubusercontent.com/9fb5bd688326db2a9ab9200e5719fd06210bf1e916687420678b51c0f0e161ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746172636974697a656e77696b692f6d6564696177696b69617069) [![packagist downloads />
    setConsumerFromCredentials(
    'ConsumerToken',
    'ConsumerSecret'
);

$manager->setTokenFromCredentials(
    'AccessToken',
    'AccessSecret'
);
```

### BaseRequest

[](#baserequest)

Each request object extend the BaseRequest class.
The base request class contains the following methods:

```
$request->queryParams(); // Returns the query params as an array
$request->json(); // Set the request format to 'json'
$request->csrfToken('TOKEN'); // Set the csrf token for this request
$request->formatVersion('latest'); // Set the formatversion. Valid values are 1, 2, 'latest'
$request->withTimestamp(); // Set the 'curtimestamp' param to 1
$request->addParam('key', 'value');
$request->request(); // Send the request, returns a MediaWikiResponse
$request->request([
  'timeout' => 10,
]); // Send the request with additional GuzzleClient options
```

### Query

[](#query)

Methods

```
$query = MediaWikiApi::query();

// Add meta params
$query->meta('tokens'); // Param meta is now 'tokens'
$query->meta('siteinfo')->meta('...'); // Param meta is now 'tokens|siteinfo|...'

// Add prop params
$query->prop('categories'); // Param prop is now 'categories'

// Set the pages to work on
$query->titles('Title1|Title2');
// Or
$query->titles('Title1')->titles('Title2');

// Set a category limit if prop('categories') was set
$query->cllimit(-1); // return 'max'
$query->cllimit(100); // return 100

// Force authentication
$query->withAuthentication();
```

Request a CSRF token:

```
$response = MediaWikiApi::query()->meta('tokens')->request();

// True if request was not successful
$response->hasErrors(); // boolean
$response->getErrors(); // array

// True if request has warnings
$response->hasWarnings(); // boolean
$response->getWarnings(); // array

$token = $response->getQuery()['tokens'];
```

### Parse

[](#parse)

Methods

```
$parse = MediaWikiApi::parse();

// Set a page to parse
$parse->page('Example');

// Add prop params
$parse->prop('text'); // Param prop is now 'text'
```

### Edit

[](#edit)

Methods

```
$edit = MediaWikiApi::edit();

// Set the page title to edit
// Unsets a previously set page ID!
$edit->title('Example');

// Or use a page ID
// Unsets a previously set title!
$edit->pageId(1);

// Add text to the page
// Automatically sets the md5 hash
$edit->text('Content');

// Edit an existing section
$edit->section(1);

// Add a new section
$edit->section();

// Set the section title
$edit->sectionTitle('Title');

// Set an edit summary
$edit->summary('This was an API edit');

// Set mode to create only
$edit->createOnly();

// Set edit to minor
// Unsets not minor
$edit->minor();

// Set edit to notminor
// Unsets minor
$edit->notMinor();

// Set edit as bot edit
$edit->markBotEdit();

// Set the CSRF Token
$edit->csrfToken('token');
```

### Action

[](#action)

A generic class for requesting arbitrary API actions

```
// Creates an action object with ?action=action-name, request method to 'GET' and auth to false
$action = MediaWikiApi::action('action-name');

// Creates an action object with ?action=foo, request method to 'POST' and auth to true
$actionPostAuth = MediaWikiApi::action('foo', 'POST', true);

// Creates an action object with ?action=bar
$actionBar = MediaWikiApi::action('bar');
$actionBar->withAuthentication(); // auth is now true

// Adding parameters
$action->addParam('name', 'value'); // &name=value

$action->addParam('delete', true); // &delete=true
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~306 days

Total

4

Last Release

1080d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76faf7e3fa9f40dc9e0a6e9ac0b151b48ec141c58e42bb26b945640be03446e3?d=identicon)[Octfx](/maintainers/Octfx)

---

Top Contributors

[![octfx](https://avatars.githubusercontent.com/u/6594492?v=4)](https://github.com/octfx "octfx (74 commits)")

---

Tags

laravelmediawiki-apioauth

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/starcitizenwiki-mediawikiapi/health.svg)

```
[![Health](https://phpackages.com/badges/starcitizenwiki-mediawikiapi/health.svg)](https://phpackages.com/packages/starcitizenwiki-mediawikiapi)
```

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[njoguamos/laravel-turnstile

A laravel wrapper for https://developers.cloudflare.com/turnstile/

2315.9k2](/packages/njoguamos-laravel-turnstile)

PHPackages © 2026

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