<?php

namespace App\Http\Controllers\Admin\Shop;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use App\Repositories\Shop\Orders;
use App\Datatables\Shop\OrdersDataTable;

class OrderController extends Controller
{
    public function index(OrdersDataTable $dataTable)
    {
        return $dataTable->render('Admin.Shop.Orders.list');
    }

    public function create()
    {
        return view('Admin.Shop.Orders.create');
    }

    public function store(Request $request)
    {
        $ret = Orders::store($request->all());
        return redirect()->route('Admin.Shop.Orders.index');
    }

    public function show($id)
    {
        $data = Orders::get($id);
        return view('Admin.Shop.Orders.view', $data);
    }

    public function edit($id)
    {
        $data['customer'] = Orders::get($id)->toArray();
        return view('Admin.Shop.Orders.edit', $data);
    }

    public function destroy($id)
    {
        return Orders::destroy($id);
    }
}
