39 lines
854 B
PHP
39 lines
854 B
PHP
|
<?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'));
|
||
|
}
|
||
|
}
|