<?php

namespace App\Http\Controllers\API\v1;

use App\Http\Controllers\BaseController;
use App\Http\Controllers\Controller;
use App\Http\Requests\TeacherStoreRequest;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class TeacherController extends BaseController
{

    public function store(TeacherStoreRequest $request)
    {
        DB::table('commentaires')
            ->insert([
                'comment_text' => $request('comment_text'),
                'user_media_id' => $request('user_media_id'),
                'comment_id' => $request('comment_id')
            ]
        );
    }

    public function update(Request $request, $id)
    {
        DB::table('users')
            ->where('id', $id)
            ->update([
                'comment_text' => $request('comment_text'),
                'user_media_id' => $request('user_media_id'),
                'comment_id' => $request('comment_id')
            ]
        );
    }

}
