New-OMIS/Modules/PMS/app/Repositories/ProjectRepository.php

40 lines
749 B
PHP
Raw Normal View History

2024-04-16 11:14:18 +00:00
<?php
namespace Modules\PMS\Repositories;
use Modules\PMS\Models\Project;
class ProjectRepository implements ProjectInterface
{
public function findAll()
{
return Project::paginate(20);
}
public function getProjectById($ProjectId)
{
return Project::findOrFail($ProjectId);
}
public function delete($ProjectId)
{
Project::destroy($ProjectId);
}
public function create($ProjectDetails)
{
return Project::create($ProjectDetails);
}
public function update($ProjectId, array $newDetails)
{
return Project::whereId($ProjectId)->update($newDetails);
}
public function pluck()
{
return Project::pluck('project_name', 'id');
}
}