<?php
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$penugasan = \App\Models\Penugasan::latest()->first();
echo "Last Penugasan ID: " . ($penugasan ? $penugasan->id : 'null') . "\n";
echo "Kegiatan: " . ($penugasan ? $penugasan->kegiatan : 'null') . "\n";
if ($penugasan) {
    $petugas = $penugasan->petugas()->pluck('users.id')->toArray();
    echo "Petugas IDs: " . json_encode($petugas) . "\n";
}

$user = \App\Models\User::where('username', 'hari_disnaker')->first();
echo "hari_disnaker ID: " . ($user ? $user->id : 'null') . "\n";
