mr.incognito/laravel-calculator
最新稳定版本:v1.1
Composer 安装命令:
composer require mr.incognito/laravel-calculator
包简介
A Simple calculator laravel package
README 文档
README
A simple calculator service for Laravel applications that provides basic arithmetic operations such as addition, subtraction, multiplication, and division.
Installation
Follow the steps below to install the mr.incognito/laravel-calculator package into your Laravel application.
1. Install via Composer
Run the following command to add the package to your Laravel project:
composer require mr.incognito/laravel-calculator
or
composer require mr.incognito/laravel-calculator --ignore-platform-reqs
Usage
Once installed, you can begin using the CalculatorService in your Laravel application.
1. Addition
$result = $calculator::add(5, 10); output 15
2. subtraction
$result = $calculator::subtract(10, 10); output 0
3. multpilication
$result = $calculator::subtract(5, 10); output 50
4. divide
$result = $calculator::subtract(10, 5); output 2
Alternatively, you can resolve the CalculatorService directly from the service container:
$calculator = app(MrIncognito\LaravelCalculator\Services\CalculatorService::class); $result = $calculator->add(5, 10); // Returns 15
License
This package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-10