<?php

namespace App\Repositories\Eloquent;

use App\Models\RecruiterProfile;
use App\Repositories\Contracts\RecruiterProfileRepositoryInterface;

class RecruiterProfileRepository implements RecruiterProfileRepositoryInterface
{
    public function all() {
        return RecruiterProfile::with('user')->get();
    }

    public function find($id) {
        return RecruiterProfile::with('user')->findOrFail($id);
    }

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

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

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