Giter Site home page Giter Site logo

laravelfortnite's Introduction

LaravelFortnite

StyleCI License Monthly Downloads

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

  1. 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;
[...]
?>
  1. 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");
?>
  1. 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

  1. Get an user id
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");

$data = $api->user->id('username');

echo $data->uid;
echo $data->username;
?>
  1. 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);
?>
  1. Get the daily store
<?php
$api = new LaravelFortnite;
$api->setKey("YOUR KEY");

$api = new FortniteClient;

$data = $api->items->store();

dump($data);
?>

  1. 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.

laravelfortnite's People

Contributors

elreco avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.