<?php

namespace App\Repositories\Eloquent;

use App\Models\JobPost;
use App\Repositories\Contracts\JobPostRepositoryInterface;

class JobPostRepository implements JobPostRepositoryInterface
{
    public function all() {
        return JobPost::all();
    }

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

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

    public function update(JobPost $jobPost, array $data) {
        $jobPost->update($data);
        return $jobPost;
    }

    public function delete(JobPost $jobPost) {
        return $jobPost->delete();
    }
}