<?php

namespace App\Repositories\Eloquent;

use App\Models\Certification;
use App\Repositories\Contracts\CertificationRepositoryInterface;

class CertificationRepository implements CertificationRepositoryInterface
{
    public function all() {
        return Certification::all();
    }

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

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

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

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