StocksNew/Modules/Recruit/app/Repositories/JobPostRepository.php

40 lines
767 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Recruit\Repositories;
use Modules\Recruit\Models\JobPost;
class JobPostRepository implements JobPostInterface
{
public function findAll()
{
return JobPost::get();
}
public function getJobPostById($jobPostId)
{
return JobPost::findOrFail($jobPostId);
}
public function delete($jobPostId)
{
JobPost::destroy($jobPostId);
}
public function create(array $jobPostDetails)
{
return JobPost::create($jobPostDetails);
}
public function update($jobPostId, array $newDetails)
{
return JobPost::where('job_post_id', $jobPostId)->update($newDetails);
}
public function pluck(){
return JobPost::pluck('title', 'job_post_id');
}
}