PHPackages                             javaabu/pgodb-sdk - 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. javaabu/pgodb-sdk

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

javaabu/pgodb-sdk
=================

The Criminal Justice Sector SDK is a wrapper package that allows developers to integrate their existing data infrastructure with the data-sharing platform developed by the Prosecutor General's Office.

v0.1.0(3y ago)026[5 issues](https://github.com/Javaabu/pgodb-sdk/issues)[1 PRs](https://github.com/Javaabu/pgodb-sdk/pulls)1MITPHPPHP ^7.4

Since Jan 24Pushed 3y ago4 watchersCompare

[ Source](https://github.com/Javaabu/pgodb-sdk)[ Packagist](https://packagist.org/packages/javaabu/pgodb-sdk)[ Docs](https://github.com/javaabu/pgodb-sdk)[ RSS](/packages/javaabu-pgodb-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (3)Used By (1)

The Criminal Justice Sector DataShare SDK
=========================================

[](#the-criminal-justice-sector-datashare-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/730ba6a1416094cecdb7e7c8ecdaa78be08f35bcd19542d27b22b4278cd7ed4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6176616162752f70676f64622d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/javaabu/pgodb-sdk)

General PHP SDK to interact with the API of the Prosecutor General's Office's criminal justice sector database.

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

[](#installation)

Use Composer to install the package

```
composer require javaabu/pgodb-sdk

```

### Pre-Requisites

[](#pre-requisites)

- PHP 7.4

Basic Usage
-----------

[](#basic-usage)

### Initialisation

[](#initialisation)

The API key is taken as a single, mandatory parameter.

```
$apiKey = "iK4YfZe2i1RAe22tKP4xejGKDZP ....";
$baseUri = "http://pgodb.test/api/v1/"
$pgoDb = new PgoDB($apiKey, $baseUri);
```

*Note*

- Check the SOP to understand how to get an API token (you may use either a personal access token or a password token). Use this as the `API_TOKEN`.
- Use the `host` parameter, defined in the API documentation, as the `BASE_URI`.

### Retrieve all Models

[](#retrieve-all-models)

```
$pgoDb->criminalCase()->get();
```

### Retrieve by Id

[](#retrieve-by-id)

We do not use database ids, but rather administrative identification strings such as an individual's national identity card number, passport number, registration number (for judges and lawyers), incident reference numbers, gaziyyah numbers and the like.

```
$pgoDb->criminalCase()->find($idString);
```

This is a wrapper for the `filter` functionality built into this package. An alternate way of doing this is as follows:

```
$pgoDb->criminalCase()->addFilter("search", $idString)->get();
```

The search term would change depending on the model being retrieved. The `find` function abstracts this complexity away for the user.

### Store Non-Nested Model

[](#store-non-nested-model)

```
// Sample data
$data = [
    "incident_reference_number": "2123756022",
    "institution_reg_no": "pgo",
    "incident_at": "1996-12-30T09:11:26.000000Z",
    "lodged_at": "1998-03-13T19:00:00.000000Z"
];

$pgoDb->criminalCase()->store($data);
```

### Store Nested Model

[](#store-nested-model)

```
// Sample data
$data = [
    "individual": [
        "nid": "A169993",
        "name": "Dr. Larissa Stokes",
        "name_en": "Mr. Benedict Lockman I",
        "gender": "female",
        "mobile_number": "860.660.2765",
        "nationality_code": "MV",
        "permanent_address_country_code": "MV",
        "permanent_address_city_code": "LD0894",
        "permanent_address": "67353 Rebeka Road\nEast Opal, PA 94709",
        "individual_type": "local",
        "dob": "1995-07-14T19:00:00.000000Z",
        "email": "pemmerich@example.net"
    ]
];

$pgoDb->criminalCase()
      ->whereId("7/2022")
      ->complainant()
      ->store($data);
```

### Update Non-Nested Model

[](#update-non-nested-model)

```
// Sample data
$data = [
    "institution_reg_no": "javaabu",
];

$pgoDb->criminalCase()
      ->whereId("2123756022")
      ->update($data);
```

### Update Nested Model

[](#update-nested-model)

```
// Sample data
$data = [
    "individual": [
        "permanent_address_country_code": "MV",
    ]
];

$pgoDb->criminalCase()
      ->whereId("7/2022")
      ->complainant()
      ->whereId("A169993")
      ->update($data);
```

### Sorting

[](#sorting)

```
$pgoDb->criminalCase()
      ->addSort("created_at")
      ->addSortByDesc("updated_at")
      ->get()
```

Ending Functions
----------------

[](#ending-functions)

The ending functions of each of these chained functions are defined as follows. The actual API request will be sent once these ending functions are called at the end of the chain.

- `get()` Should return a list of items,
- `find($id)` Should return a single item,
- `delete($id)` Sends a delete request and returns true or false,
- `store($data)` Returns the newly stored record,
- `update($data)` Returns the updated record.

Changelog
---------

[](#changelog)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Ibrahim Hussain Shareef](https://github.com/ihshareef)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.3% 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

1213d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6671720?v=4)[Arushad Ahmed](/maintainers/dash8x)[@dash8x](https://github.com/dash8x)

![](https://avatars.githubusercontent.com/u/31658513?v=4)[Javaabu](/maintainers/javaabu)[@Javaabu](https://github.com/Javaabu)

![](https://avatars.githubusercontent.com/u/7188633?v=4)[Hussain Afeef](/maintainers/ibnnajjaar)[@ibnnajjaar](https://github.com/ibnnajjaar)

![](https://www.gravatar.com/avatar/e799f0bd10d4438d57b4ea679ffbaeda2d7aa6145e7a7031d61758481563a203?d=identicon)[ihshareef](/maintainers/ihshareef)

---

Top Contributors

[![ihshareef](https://avatars.githubusercontent.com/u/7621646?v=4)](https://github.com/ihshareef "ihshareef (61 commits)")[![dash8x](https://avatars.githubusercontent.com/u/6671720?v=4)](https://github.com/dash8x "dash8x (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

Javaabu Pvt Ltdpgodb-sdk

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/javaabu-pgodb-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/javaabu-pgodb-sdk/health.svg)](https://phpackages.com/packages/javaabu-pgodb-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)

PHPackages © 2026

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