<?php

namespace App\Http\Controllers;

use App\GoodReceipts;
use Illuminate\Http\Request;

class GoodReceiptsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        // $goods = GoodReceipts::all();

        return view('goods_receipts.index');
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        // $discounts = Discounts::all();
        return view('goods_receipts.create');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $store = new GoodReceipts();
        $store->name = $request->name;
        $store->bill_no = $request->bill_no;
        $store->bilty_no = $request->bilty_no;
        $store->status = $request->status;
        $store->save();
        session()->flash('success', "New Discounted Added Successfully");

        return redirect('goods.list');
    }


    /**
     * Display the specified resource.
     *
     * @param  \App\GoodReceipts  $goodReceipts
     * @return \Illuminate\Http\Response
     */
    public function show(GoodReceipts $goodReceipts)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\GoodReceipts  $goodReceipts
     * @return \Illuminate\Http\Response
     */
    public function edit(GoodReceipts $goodReceipts)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\GoodReceipts  $goodReceipts
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, GoodReceipts $goodReceipts)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\GoodReceipts  $goodReceipts
     * @return \Illuminate\Http\Response
     */
    public function destroy(GoodReceipts $goodReceipts)
    {
        //
    }
}
