This is a Fortnite API provider for Laravel using FortniteAPI.com. You can get user wins, kills, the latest news, fortnite server status and many more with this API.
Thanks to samhoogantink for the PHP code.
Via Composer
$ composer require elreco/laravelfortnite
In your Laravel project root directory
- Add
'Elreco\LaravelFortnite\LaravelFortnite'
to your Controller file
<?php
namespace App\Http\Controllers;
use App\User;
use App\Http\Controllers\Controller;
use Elreco\LaravelFortnite\LaravelFortnite;
[...]
?>
- Init a new LaravelFortnite object and set your api Key. You can have a key by registering on FortniteAPI.com
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
?>
- Get datas from the API
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
// get and user id
$data = $api->user->id('username');
?>
You can build website like mine : tracker.fortnitefrance.eu
- Get an user id
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
$data = $api->user->id('username');
echo $data->uid;
echo $data->username;
?>
- Get user stats V2
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
$api->user->uid = 'user_id';
$data = $api->user->stats('console', 'window');
dump($data);
?>
- Get the daily store
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
$api = new FortniteClient;
$data = $api->items->store();
dump($data);
?>
- Fortnite server status
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");
$data = $api->status->fetch();
echo $data->status;
echo $data->message;
echo $data->version;
?>
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.