/**
  * Display a listing of the resource.
  * /api/admin/purchases
  * @return Response
  */
 public function index()
 {
     $purchases = Purchase::with('squares', 'media')->orderby('created_at', 'desc')->get();
     return view('admin.purchases', ['purchases' => $purchases]);
 }
 /**
  * Display a listing of the resource.
  * /api/admin/purchases
  * @return Response
  */
 public function index()
 {
     $purchases = Purchase::with('squares', 'media')->orderby('created_at', 'desc')->paginate(10);
     $purchases->setPath('purchases');
     return view('admin.purchases', ['purchases' => $purchases]);
 }