<?php

namespace App\Http\Controllers;

use App\Models\CelebrityDiscount;
use Illuminate\Http\Request;

class CelebrityDiscountController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }


    public function index()
    {
        $celebrity = \DB::table('celebrity_discounts')->get();
        return view('discount-page', [
            'celebrity' => $celebrity
        ]);
    }


  
    public function store(Request $request)
    {
        $data = new CelebrityDiscount;
        $data -> discount_code = $request -> discount_code;
        $data -> discount_percentage = $request -> discount_percentage;
        $data -> discount_barcode = $request -> barcode;
        $data -> discount_holder_name = $request -> discount_holder_name;
        $data -> save();
        return 123;
    }

    public function destroy(CelebrityDiscount $celebrityDiscount)
    {
        $celebrityDiscount->delete();
        return 123;
    }
}
