elreco / laravelfortnite
This package is abandoned and no longer maintained.
No replacement package was suggested.
Fortnite API for Laravel
dev-master
2019-08-23 14:43 UTC
Requires
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2020-02-23 15:58:34 UTC
README
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.
Installation
Via Composer
$ composer require elreco/laravelfortnite
In your Laravel project root directory
Usage
- 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');
?>
Examples
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;
?>
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.