PHPackages                             fanboykun/decissionsupportsystem - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fanboykun/decissionsupportsystem

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fanboykun/decissionsupportsystem
================================

Decission Support System's Method Calculator

v1.0-beta(4y ago)112MITPHPPHP ^7.4|^8.0

Since Nov 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fanboykun/decissionsupportsystem)[ Packagist](https://packagist.org/packages/fanboykun/decissionsupportsystem)[ Docs](https://github.com/fanboykun/decissionsupportsystem)[ RSS](/packages/fanboykun-decissionsupportsystem/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Decission Support System's Method Calculator
============================================

[](#decission-support-systems-method-calculator)

This is a laravel package to do certain method of Decision Support System. make sure to always use latest version of Laravel, and minimum PHP version is 7.4.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require fanboykun/decissionsupportsystem
```

you don't have to configure anything, it's ready to use as it functionality is only to make calculation based on your method's choise (explained below)

Usage
-----

[](#usage)

import the class on your controller

```
use Fanboykun\DecissionSuppportSystem\DecissionSuppportSystem;
```

and then use it as a parameter on your function, example :

```
public function calculate (DecissionSupportSystem $decissionSupportSystem)
{
    // for example, let's use moora as the method, you can choose what method you want to use, method list and the function are available below
    $result = $decissionSupportSystem->mooraOperator($your_data_to_calculate);

    return $result;
}
```

or you can make a new class instance, example :

```
public function calculate ()
{
    // for example, let's use moora as the method, you can choose what method you want to use, method list and the function are available below
    $decissionSupportSystem = new DecissionSupportSystem();
    $result = $decissionSupportSystem->mooraOperator($your_data_to_calculate);

    return $result;
}
```

NOTE: the returned data type is array and the data that returned is like this example :

```
$returned_data = [
    ['alternative_id' => 1, 'optimized_value' => 0.9, 'rank' => 1,],
    ['alternative_id' => 2, 'optimized_value' => 0.8, 'rank' => 2,],
    ['alternative_id' => 3, 'optimized_value' => 0.6, 'rank' => 3,],
    ['alternative_id' => 4, 'optimized_value' => 0.5, 'rank' => 4,],
    ['alternative_id' => 5, 'optimized_value' => 0.4, 'rank' => 5,],
]
```

the key of an index is `alternative_id `, and sorted by value of `optimized_value`, and add an index named `rank`.

Required Data
-------------

[](#required-data)

here is the example of the data that required and accepted, make sure to follow this step because in order to read and calculate the data, it depends on the array index name. you may have different index name so you have to map it's name and value.

example from getting the data from database and mapping it :

```
public function getData(DecissionSupportSystem $decissionSupportSystem) : array
{
   $data_to_calculate = Criteria::with('alternatives')->get()
   ->map(function ($item, $key){
       return [
           'criteria_id' => $item->id,
           'name' => $item->name,
           'type' => $item->is_cost,
           'weight' => $item->weight,
           'max_value' => $item->max_value,
           'alternatives' => $item->alternatives->map(function ($item, $key){
               return [
                   'alternative_id' => $item->id,
                   'name' => $item->name,
                   'value' => $item->pivot->value,
               ];
           })->toArray()
       ];
   })->toArray();

   // example, we use moora method
   $result = $decissionSupportSystem->mooraOperator($data_to_calculate);

   return $result;
}
```

in above example, we are getting data from the database with eloquent, we get the data from `Criteria` model that have `ManyToMany` relationship with `Alternative` model. If you are still confuse about the many to many relationship, make sure to read the Laravel documentation.

Acceptable Data Types
---------------------

[](#acceptable-data-types)

From above explaination, we know the required data to pass. Here i going to show you the data type(s)

ColumnData TypesDescriptioncriteria\_idintegerit should be unique (id)namestringit is not used to begin any operation, but it's requiredtypebooleantrue is cost and false is benefitweightfloatbetter to pass it as float, but it's accept any numeric valuemax\_valuefloatit's not required, when it's null. this package will search the max valuealternativesarrayit is an array wrapper for the alternativealternative\_idintegerit should be unique (id)namestringit is not used to begin any operation, but it's requiredvaluefloatbetter to pass it as float, but it's accept any numeric valueAvailable Method and It's Function
----------------------------------

[](#available-method-and-its-function)

- waspas :

```
waspasOperator()
```

- moora :

```
mooraOperator()
```

remember that you have to use the `DecissionSupportSystem` class, either from your function as a parameter or make a new class instance inside your function.

for now, the method that available is only those, imma add new method soon.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [fanboykun](https://github.com/fanboykun)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1645d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1df1886e94a49c42daff30f145b2c2906975e2b9a87da4006162b5a6241bfe4d?d=identicon)[fanboykun](/maintainers/fanboykun)

---

Top Contributors

[![fanboykun](https://avatars.githubusercontent.com/u/58308932?v=4)](https://github.com/fanboykun "fanboykun (7 commits)")

---

Tags

fanboykundecissionsupportsystem

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fanboykun-decissionsupportsystem/health.svg)

```
[![Health](https://phpackages.com/badges/fanboykun-decissionsupportsystem/health.svg)](https://phpackages.com/packages/fanboykun-decissionsupportsystem)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
