FleetCart/Modules/Account/Http/Controllers/AccountOrdersController.php
2023-12-03 14:07:47 +00:00

43 lines
863 B
PHP

<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Http\Response;
class AccountOrdersController
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$orders = auth()->user()
->orders()
->latest()
->paginate(20);
return view('public.account.orders.index', compact('orders'));
}
/**
* Display the specified resource.
*
* @param int $id
*
* @return Response
*/
public function show($id)
{
$order = auth()->user()
->orders()
->with(['products', 'coupon', 'taxes'])
->where('id', $id)
->firstOrFail();
return view('public.account.orders.show', compact('order'));
}
}