Download the PHP package fr3ddy/laratoor without Composer
On this page you can find all versions of the php package fr3ddy/laratoor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fr3ddy/laratoor
More information about fr3ddy/laratoor
Files in fr3ddy/laratoor
Package laratoor
Short Description Laravel package for Toornament API
License Apache-2.0
Informations about the package laratoor
Laratoor
This package will support you in any development related to the official Toornament API. After realeasing V2 of the API, many things changed. You can find a full documentation on the Toornament Page.
Installation
Installation can be done easly with composer
Add Fr3ddy\Laratoor\LaratoorServiceProvider::class to your providers array in your config/app.php
Add your API Token to your application from Toornament.
Usage
Since version two, Toornament does have four different layers in their API. The Viewer API gives you publicly available informations. The Account API will give you access to the user data. The Participant API allows you to register to a tournament and the organizer API helps you managing tournaments.
Status of implementation
Viewer API: Beta Working version which may need some more optimization
Account API: Alpha User Authorization implemented and returning user is working fine.
Participant API: TBD Not already implemented.
Organizer API: TBD Not already implemented by Toornament itself.
Viewer API
The Viewer API helps in accessing data like disciplines, featured tournaments, match information and many more.
Filter
Some of the methods allow to specify a filter. This can be done by specifying an array with the respective content to filter on.
For example:
You can find the possibilities to filter on the Toornament API page with the respective API call as Query Parameters.
Discipline
Disciplines are different games that are supported by Toornament. All major games are listed here with the publisher and some more information.
Tournaments
A tournament is a competition involving a given set of competitors. These competitors play against each others following a predefined path. Some competitors are eliminated along the way and, at the end, a single competitor is declared winner. In Toornament, competitors are defined as participants. The predefined path of matches is defined as the tournament’s structure and is composed of stages, groups, rounds, brackets, rankings and matches. A match can be further detailed with subsets of a match usually called games or match games.
Source: Toornament
Participants
The participant refers to the attendance of a competitor in a single tournament. A participant is tied to its tournament. In the case of one competitor taking part in several tournaments, he will be represented by one distinctive participant for each tournament. The participant is referenced each time there is a need to clearly identify a competitor in the tournament. For example, to identify who is playing a match or to identify the rank of a competitor in a ranking.
Source: Toornament
The participants can either be selected directly from the tournament or by the tournament id.
Stages
A stage is a major step in a tournament. Its purpose is to arrange and organize the competition for some of the participants following a specific and standardized method. The method is defined by the type of stage. There are currently six different types of stage supported on Toornament: single elimination, double elimination, round-robin groups, bracket groups, league and swiss system. Each has its own method to arrange matches between participants. Depending on its type, a stage may involve sub-elements of the structure: groups, rounds, matches, brackets and rankings.
Source: Toornament
Stages can be selected directly from the tournament or by the tournament id.
Groups
A group represents a portion of a stage that usually involves only a subset of the participants. Most of the time groups can be played simultaneously because they involve different participants. However, in some cases, a group may have to wait the outcome of another group in order to receive additional participants and continue. Some stage types do not require groups. In such case, a single group is still created as a placeholder to comply with the structure of the other stages.
Source: Toornament
Groups can be selected directly from the tournament or with the specific tournament id.
Rounds
A round represents a small step inside a group in which all participants play no more than one match. The purpose of a round is to provide a step in which all participants can, if necessary, play simultaneously.
Source: Toornament
Rounds can be selected directly from the tournament or with the specific tournament id.
Brackets
A bracket represents a type of competition in which the outcome of a match (a win or a loss) determines where the participants go next. Matches in a bracket are therefore connected between them and are often represented as a tree.
Source: Toornament
Brackets can be selected directly from the stage of a tournament or with the specific tournament and stage id.
Rankings
A ranking represents a type of competition in which the outcome of a match rewards the participants with points. These points are then used to calculate a ranking. Once the stage or the group is completed, the ranking is then used to determine the final standing of the participants in the stage.
Source: Toornament
Rankings can be selected directly from the stage of a tournament or with the specific tournament and stage id.
Matches
A match is a small structured form of play involving one or more participants. These participants play against each others following a match format and possibly smaller steps of play (such as games or match games). At the end, an outcome is defined by the match format. Depending on the number of participants involved in the match, the outcome is calculated differently. When a match only involves two participants, it is typed as duel and the result is described by a win, a draw or a loss. When a match involves more than two participants, it is typed as ffa and the result is described by a ranking. A match contains match opponents. These opponents act like slots that expect to receive a participant at some point in the tournament. A match opponent contains a number and the match-related data of a participant such as his score, his result and other game information.
Source: Toornament
Rankings can be selected directly from the stage of a tournament or with the specific tournament and stage id.
Match Games
A match game is a subset of a match that describes part of a match. It is usually where you find discipline-specific information such as maps or modes. A match game contains match game opponents. They share the same opponent number as in the match so they do not need to contain a participant. They also contain match-game-related data such as score and result and discipline-specific information such as characters.
Source: Toornament
Games of matches can only be received by the Match of a tournament.
Relations
Based on the structure Toornament has designed, each element can recieve it's parent also.
Additional Content
Toornament also provides details about the attached Streams and Videos which are attached to a tournament or a match. They can be selected with either the IDs of the element or directly from the element.
Account API
With the Account API you can access user data of the logged in user. Your visitor has to login through Toornaments oAuth2 endpoint. For this you need TOORNAMENT_CLIENT_ID and TOORNAMENT_CLIENT_SECRET in your .env file. Additionally you need to setup your redirect url in toornament too. For this you have to visit Toornament Developer Page and set the redirect url of the respective application you are working on to https://yourdomain.com/toornament/redirect. Don't mind this redirect url, you can set your own one in the application itself, this one is just needed to make the process as simple as possible for you.
As easy as this two steps, you have your user logged in and you can access his personal data.
Participant API
TBD
Organizer API
Comming soon
Disclaimer
This packages is not related in any way to Oxent or any other company related to Toornament.