<?php

namespace TPS\Admin\Http\Controllers;

use TPS\Admin\DataGrids\OrderDataGrid;
use TPS\Admin\DataGrids\OrderInvoicesDataGrid;
use Webkul\Admin\Http\Controllers\Sales\OrderController;


class Orders extends OrderController
{

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {
        if (request()->ajax())
        {
            return app(OrderDataGrid::class)->toJson();
        }

        return view($this->_config['view']);
    }

    public function invoices()
    {
        if (request()->ajax())
        {
            return app(OrderInvoicesDataGrid::class)->toJson();
        }

        return view($this->_config['view']);
    }
}