first commit
This commit is contained in:
39
Modules/PMS/app/Repositories/ProjectRepository.php
Normal file
39
Modules/PMS/app/Repositories/ProjectRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user