devjay/calculator

There is no license information available for the latest version (dev-master) of this package.

This Laravel package will do some mathematic calculations

dev-master 2019-08-05 13:56 UTC

This package is auto-updated.

Last update: 2024-10-06 01:26:41 UTC


README

A demo package for Laravel calculator

Installation

Using Composer

composer require devjay/calculator

Or manually by modifying composer.json file:

{
    "require": {
        "devjay/calculator": "dev-master"
    }
}

And run composer update && composer dump-autoload

Then add Service provider to config/app.php

    'providers' => [
        // ...
        Devjay\Calculator\CalculatorServiceProvider::class,
    ]

Shortcut methods for common request methods (It will provide you view in response)

For the GET request methods shortcut methods are available. For example:

Route::get('calculator', function(){
	echo 'Hello from the calculator package!';
});

For Adding two value 'a' and 'b' the GET request methods is called shown as below:

Route::get('add/{a}/{b}', 'Devjay\Calculator\CalculatorController@add');

For Substracting two value 'a' and 'b' the GET request methods is called shown as below:

Route::get('subtract/{a}/{b}', 'Devjay\Calculator\CalculatorController@subtract');