FleetCart/Modules/Account/Http/Controllers/AccountOrdersController.php

39 lines
854 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Account\Http\Controllers;
class AccountOrdersController
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\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 \Illuminate\Http\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'));
}
}