<?php

namespace App\Http\Controllers\Admin;

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

class FoodSettingsController extends Controller
{
    public function index()
    {
        $settings = DB::table('food_settings')->get();
        return view('profiles.leave_settings', compact('settings'));
    }

    public function store(Request $request)
    {
        DB::table('food_settings')->updateOrInsert(
            ['id' => $request->id],
            ['price' => $request->price]
        );

        return back()->with('success','Food price updated');
    }
}
