<?php

namespace App\Http\Controllers\Api\V1;

use App\OtherOption;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreOtherOptionsRequest;
use App\Http\Requests\Admin\UpdateOtherOptionsRequest;

class OtherOptionsController extends Controller
{
    public function index()
    {
        return OtherOption::all();
    }

    public function show($id)
    {
        return OtherOption::findOrFail($id);
    }

    public function update(UpdateOtherOptionsRequest $request, $id)
    {
        $other_option = OtherOption::findOrFail($id);
        $other_option->update($request->all());
        

        return $other_option;
    }

    public function store(StoreOtherOptionsRequest $request)
    {
        $other_option = OtherOption::create($request->all());
        

        return $other_option;
    }

    public function destroy($id)
    {
        $other_option = OtherOption::findOrFail($id);
        $other_option->delete();
        return '';
    }
}
