<?php

namespace App\Repositories\Eloquent;

use App\Models\Rating;
use App\Repositories\Contracts\RatingRepositoryInterface;

class RatingRepository implements RatingRepositoryInterface
{
    public function all() {
        return Rating::all();
    }

    public function find($id) {
        return Rating::findOrFail($id);
    }

    public function create(array $data) {
        return Rating::create($data);
    }

    public function update($id, array $data) {
        $rating = Rating::findOrFail($id);
        $rating->update($data);
        return $rating;
    }

    public function delete($id) {
        return Rating::destroy($id);
    }
}