2017 © Pedro Peláez
 

library dparser

Simple Dice Roller for Laravel 5.5

image

jes490/dparser

Simple Dice Roller for Laravel 5.5

  • Sunday, May 6, 2018
  • by jes490
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

DParser

Simple Dice Roller + Calculator for Laravel 5.5, (*1)

Installation

Simple require package in composer, (*2)

composer require jes490/dparser

DParser uses Laravel 5.5 Package Auto-Discovery, so you don't have to add ServiceProvider to providers array., (*3)

Without Auto-Discovery

If you don't use Package Auto-Discovery, simply add next provider to providers array in config/app.php:, (*4)

Jes490\DParser\DParserServiceProvider::class,

And if you want use Facade, add this to your aliases array in config/app.php:, (*5)

'DParser' => Jes490\DParser\Facade\DParser::class,

Usage

You can now use DParser as Facade in your app., (*6)

DParser::roll($expression);

//You can assess result of your expression like this:
DParser::roll($expression)->getResult();
//Or just use plain auto-conversion __toString()
DParser::roll('2+2'); //returns '4';

//You can access individual rolls like this:
DParser::roll('2d6')->getRolls(); //returns array of rolls results

Functionallity

Currently DParser supports next list of operators: '-', '+', '*', '/', 'd'. You can build complex expression like these:, (*7)

DParser::roll('2d6+1d8+1d12+20');
DParser::roll('2+3*2-1+2d6-3*4');

The Versions

06/05 2018

dev-master

9999999-dev

Simple Dice Roller for Laravel 5.5

  Sources   Download

MIT

The Development Requires

by Avatar jes490

15/03 2018

dev-rework

dev-rework

Simple Dice Roller for Laravel 5.5

  Sources   Download

MIT

The Development Requires

by Avatar jes490

12/11 2017

v1.0

1.0.0.0

Simple Dice Roller for Laravel 5.5

  Sources   Download

MIT

The Development Requires

by Avatar jes490