Laravel wrapper for simple PHP package for add two numbers
To get the latest version of Laravel Sum
, simply require the project using Composer:
composer require nazububu/laravel-sum
Or manually update require
block of composer.json
and run composer update
.
{
"require": {
"nazububu/laravel-sum": "^1.0"
}
}
Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Nazububu\LaravelSum\SumServiceProvider::class,
If you want to use the facade, add this to your facades in app.php:
'Sum' => Nazububu\LaravelSum\Facades\Sum::class,
use Nazububu\LaravelSum\Sum;
$sum = new Sum;
echo $sum->calculate(1, 1); // 2
You can run tests with command
vendor/bin/phpunit tests/