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

$token = 'simulate-from-db';
$user = \App\Models\User::where('role', 'admin')->first();
$tokenStr = $user->createToken('test')->plainTextToken;

$response = \Illuminate\Support\Facades\Http::withToken($tokenStr)
    ->acceptJson()
    ->post('http://127.0.0.1:8000/api/penugasan/4/update-status', [
        'status' => 'on_progres',
    ]);

echo "Status: " . $response->status() . "\n";
echo "Body: " . $response->body() . "\n";
