aadha / laravel_math
basic math related calculation
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/aadha/laravel_math
This package is not auto-updated.
Last update: 2025-12-16 14:21:24 UTC
README
This is a simple math library for Laravel that provides functions to calculate Fibonacci numbers and check if a number is prime.
Installation
- Clone the repository to your local machine.
- Navigate to the project directory.
- Run
composer installto install dependencies.
Usage
Fibonacci
To calculate the Fibonacci number of a given integer:
use Aadhar\Math\Math; echo Math::fibonacci(10); // Output: 55
Prime Check
To check if a given number is prime:
use Aadhar\Math\Math; echo Math::isPrime(7); // Output: true
Using with Laravel
-
Add the service provider to the
config/app.phpfile in theprovidersarray:'providers' => [ // ...existing code... Aadhar\Math\MathServiceProvider::class, ],
-
(Optional) Add the alias to the
config/app.phpfile in thealiasesarray:'aliases' => [ // ...existing code... 'Math' => Aadhar\Math\Facades\Math::class, ],
-
Use the Math library in your Laravel application:
use Math; $fibonacci = Math::fibonacci(10); $isPrime = Math::isPrime(7);
License
This project is licensed under the MIT License.