darkgoldblade01/dnd-5e-api

A DND 5e API wrapper written in PHP

dev-master 2021-02-04 06:38 UTC

This package is auto-updated.

Last update: 2024-05-04 13:53:29 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

This package is a PHP wrapper for the DND5eAPI.

Installation

You can install the package via composer:

composer require darkgoldblade01/dnd-5e-api

Usage

use Darkgoldblade01\Dnd5eApi;

$api = new Dnd5eApi();

// Get Ability Scores API
$ability_scores_api = $api->ability_scores();

// Get Skills
$skills_api = $api->skills();

// Get Proficiences
$proficiencies_api = $api->proficiencies();

// You can get all items under an api
// This returns an array with all the ability scores in the AbilityScores Models
$ability_scores_api->all();

// Returns the AbilityScore Model based on the index
$ability_scores_api->{ability_score_index}();
//For instance:
$ability_scores_api->cha(); // Returns the Charisma AbilityScores Model
        

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.