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

use App\Models\Order;

$orders = Order::where('is_reseller_order', 1)->latest()->take(5)->get([
    'id', 'order_number', 'subtotal', 'grand_total',
    'total_reseller_price', 'total_reseller_profit', 'shipping_cost',
    'customer_name', 'status', 'created_at'
]);

foreach ($orders as $o) {
    echo "ID: {$o->id} | {$o->order_number}\n";
    echo "  subtotal:              {$o->subtotal}\n";
    echo "  grand_total:           {$o->grand_total}\n";
    echo "  total_reseller_price:  {$o->total_reseller_price}\n";
    echo "  total_reseller_profit: {$o->total_reseller_profit}\n";
    echo "  shipping_cost:         {$o->shipping_cost}\n";
    echo "  customer:              {$o->customer_name}\n";
    echo "\n";
}
