<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Models\BeneficioNivel;
use App\Repositories\BeneficioNivelRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Tools;

class BeneficioNivelAPIController extends Controller
{
    private $beneficioNivelRepository;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct(BeneficioNivelRepository $beneficioNivelRepository)
    {
        $this->beneficioNivelRepository = $beneficioNivelRepository;
    }
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create(Request $request)
    {


    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {

    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Models\Color  $color
     * @return \Illuminate\Http\Response
     */
    public function show(EstadoCivil $estadoCivil)
    {
        //
    }


    public function getBeneficioNiveles(){
        $beneficioNiveles = $this->beneficioNivelRepository->orderBy('id')->get();//->orderBy("id", "asc");;

        if ($beneficioNiveles->isEmpty()) {
            return $this->sendError('Lista de Beneficio Niveles vacia');
        } else {
            return $this->sendResponse($beneficioNiveles, 401);
        }
    }
    

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

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

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


   
}
