<?php

namespace App\Http\Controllers\EndoBOOK\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Mongo;

class PrepareController extends Controller
{

    public function store(Request $r)
    {
        if (isset($r->event)) {
            $event  = $r->event;
            return $this->$event($r);
        }
    }

    public function text_paper($r){
        $tb_casenote = Mongo::table("tb_casenote")->where("_id",$r->nid)->first();
        $tb_casenote[$r->group][$r->subgroup] = $r->value;
        Mongo::table("tb_casenote")->where("_id",$r->nid)->update($tb_casenote);
    }

}
