<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\Rating;

class RatingController extends Controller
{
    public function index(Request $request)
    {
        $rating = new Rating;
        $rating->rate = $request->rate;
        $rating->comment = $request->comment;
        $rating->save();
        return ['code' => $rating->save() ? 200 : 500];
    }
}
