PHPackages                             mariusdrg/laravel-fivem-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. [API Development](/categories/api)
4. /
5. mariusdrg/laravel-fivem-api

ActiveLibrary[API Development](/categories/api)

mariusdrg/laravel-fivem-api
===========================

This package is used for fetching GTA FiveM server information.

310PHP

Since Nov 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mariusdrg/laravel-fivem-api)[ Packagist](https://packagist.org/packages/mariusdrg/laravel-fivem-api)[ RSS](/packages/mariusdrg-laravel-fivem-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

mariusdrg/laravel-fivem-api
---------------------------

[](#mariusdrglaravel-fivem-api)

Package which allows you to fetch GTA FiveM Servers information related to their online players and general properties as JSON array.

Dependencies
------------

[](#dependencies)

PHP &gt;= 8.0
illuminate/support &gt;=5.4
guzzlehttp/guzzle &gt;=7.0

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

[](#installation)

### To install with Composer simply use:

[](#to-install-with-composer-simply-use)

`composer require mariusdrg/laravel-fivem-api`

ServiceProvider in Laravel
--------------------------

[](#serviceprovider-in-laravel)

`use Mariusdrg\LaravelFivemApi\Services\LFAService;`

Functions
---------

[](#functions)

`getServer()` - will return you entire JSON with server information (resources, players, server properties)
`getServerInfo()` - will return only server properties such as: server name, banners, website, description etc.
`getLocale()` - will return server locale language ISO 639-1 code
`getResources()` - will return the list of resources
`getLicenseKeyToken()` - will return server's license key token
`getAllPlayers()` - will return all online players and their information (endpoint, id, identifiers, name and ping)
`getOnlinePlayers()` - will return ONLY the number of total players
`getMaxPlayers()` - will return the number of max players allowed by server's properties All of them based on API GET responses received from `http://0.0.0.0:30120/x.json`.

Usage
-----

[](#usage)

```
$client = new LFAService("127.0.0.1"); //replace 127.0.0.1 with your server's IP | Port is set by default as 30120
//or
$client = new LFAService("127.0.0.1", 30121); //second parameter allows you to set a custom Port if necessary

$client->getServer();

```

Example

```
namespace App\Http\Controllers;

use Mariusdrg\LaravelFivemApi\Services\LFAService;

class IndexController extends Controller
{
    public function index() {
        $lfa = new LFAService("127.0.0.1");
        return view('index', ['server' => $lfa->getServer()]);
    }
}

```

The response will look like:

```
{
    "enhancedHostSupport": true,
    "icon": "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt",
    "requestSteamTicket": "off",
    "resources": ["hardcap","rcore_bowling","easy_allowlist","safecracker","boatdealer"],
    "server": "FXServer-master SERVER v1.0.0.6683 win32",
    "vars": {
        "JD_logs": "V3.0.4",
        "banner_connecting": "https://i.imgur.com/YYY.png",
        "banner_detail": "https://i.imgur.com/XXX.png",
        "gamename": "gta5",
        "locale": "en-US",
        "onesync_enabled": "true",
        "sv_enforceGameBuild": "2502",
        "sv_enhancedHostSupport": "true",
        "sv_lan": "false",
        "sv_licenseKeyToken": "3443444x0000000000000000_4627049:0e82a33e8f0c1ab0b5b95d04f48e235099054ecebad8ah8aed4a8951a8a218b8",
        "sv_maxClients": "128",
        "sv_projectDesc": "^5wcodero",
        "sv_projectName": "^5In-House Development |  ^5Drugs and Heists  |  ^4Wars  |  ^5Active Gangs  |  ^4Active Staff  |  ^5Exclusive Scripts  | 16+",
        "sv_pureLevel": "1",
        "sv_scriptHookAllowed": "false",
        "tags": "roleplay, rp, qbcore, qb-core, serious",
        "txAdmin-version": "6.0.1"
    },
    "version": 1683688455
}

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a9bdf36d51a966b171235e5f7403369dfcf9bcba533cb372eb982a623349b2b?d=identicon)[mariusdrg](/maintainers/mariusdrg)

---

Top Contributors

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

---

Tags

apifivemlaravelpackagephpserver

### Embed Badge

![Health badge](/badges/mariusdrg-laravel-fivem-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M453](/packages/google-gax)

PHPackages © 2026

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