<?php

namespace App\Http\Controllers;

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

class RecompenseController extends GenericController
{
    public function __construct()
    {
        $this->setModel(new Recompense());
    }

    public function index(){
        return parent::getListView();
    }

    public function ajaxList(Request $request){
        return parent::dataList($request);
    }

    public function save(Request $request)
    {
        if($request->get('_id')!=0){
            $this->setModel(Recompense::find($request->get('_id')));
        }
        $redirect = parent::add($request);
        return $redirect;
    }

}
