<?php

namespace App\Http\Controllers\Admin\Shop;

use Illuminate\Http\Request;

use App\Repositories\Shop\Homepages;
use App\Datatables\Shop\HomepagesDataTable;

class HomepageController extends Controller
{
    public function index(HomepagesDataTable $dataTable)
    {
        return $dataTable->render('Admin.Shop.Homepages.list', $data ?? []);
    }

    public function create()
    {
        return view('Admin.Shop.Homepages.create', $data ?? []);
    }

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

    public function show($id)
    {
        return view('Admin.Shop.Homepages.view', $data ?? []);
    }

    public function edit($id)
    {
        $data['homepage'] = Homepages::get($id);
        return view('Admin.Shop.Homepages.edit', $data);
    }

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