Current File : /home/tradevaly/www/app/Http/Controllers/User/InvoiceController.php
<?php

namespace App\Http\Controllers\User;

use App\Http\Controllers\Controller;
use App\Models\ProductInvoices;
use App\Models\OrderItem;
use Brian2694\Toastr\Facades\Toastr;
use Carbon\Carbon;


class InvoiceController extends Controller
{
  public function invoice($id)
  {
      $invoice = ProductInvoices::where('order_id',$id)->where('buyer_id',auth()->id())->firstOrFail();
      $orders = OrderItem::where('order_id',$id)->get();
      return view('user.pages.invoice.product_invoice',compact('invoice','orders'));
  }
  public function moneyReceipt($id)
  {
      $invoice = ProductInvoices::where('order_id',$id)->where('buyer_id',auth()->id())->firstOrFail();
      return view('user.pages.invoice.product_money_receipt',compact('invoice'));
  }
}