PHP code example of javaabu / pgodb-sdk-laravel

1. Go to this page and download the library: Download javaabu/pgodb-sdk-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

javaabu / pgodb-sdk-laravel example snippets


// config/pgodb.php 
... 
'api_key' => env('PGODB_API_KEY'),
'base_uri' => env('PGODB_BASE_URI')    
...
 
use PgoDbAPI;

$criminal_case = PgoDbAPI::criminalCase()->find('376/2022');

PgoDbAPI::criminalCase()->get();

PgoDbAPI::criminalCase()->find($idString);

PgoDbAPI::criminalCase()->addFilter("search", $idString)->get();

// 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"
];

PgoDbAPI::criminalCase()->store($data);

// 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": "[email protected]"
    ]
];

PgoDbAPI::criminalCase()
      ->whereId("7/2022")
      ->complainant()
      ->store($data);

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

PgoDbAPI::criminalCase()
      ->whereId("2123756022")
      ->update($data);

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

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

PgoDbAPI::criminalCase()
      ->addSort("created_at")
      ->addSortByDesc("updated_at")
      ->get()
 php
$pgodb = App::make('pgodb-api');
$criminal_case = $pgodb->criminalCase()->find('376/2022');