PHP code example of thibitisha / kmpdc-seeder

1. Go to this page and download the library: Download thibitisha/kmpdc-seeder 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/ */

    

thibitisha / kmpdc-seeder example snippets


use App\Models\Practitioner;

Practitioner::with(['status', 'speciality', 'subSpeciality', 'qualifications'])->first();

use App\Models\Practitioner;

// Fetch one doctor
$doctor = Practitioner::with(['status', 'speciality', 'subSpeciality', 'qualifications.degree', 'qualifications.institution'])->first();

$doctor->full_name;             // "Dr JOHN DOE"
$doctor->status->name;          // "ACTIVE"
$doctor->speciality?->name;     // "SURGERY"
$doctor->subSpeciality?->name;  // "CARDIOLOGY"

// Get all unique institutions
\App\Models\Institution::pluck('name');

// Find all practitioners under Internal Medicine
\App\Models\Practitioner::whereHas('speciality', fn($q) => $q->where('name', 'INTERNAL MEDICINE'))->count();
bash
php artisan kmpdc:sync

storage/app/kmpdc-data/csv
└── 0000_00_00_122105_kmpdc_practitioners.csv
bash
php artisan kmpdc:extract
bash
php artisan tinker