first commit
This commit is contained in:
35
Modules/Admin/app/Repositories/ComplaintRepository.php
Normal file
35
Modules/Admin/app/Repositories/ComplaintRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Complaint;
|
||||
|
||||
|
||||
class ComplaintRepository implements ComplaintInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Complaint::get();
|
||||
}
|
||||
|
||||
public function getComplaintById($complaintId)
|
||||
{
|
||||
return Complaint::findOrFail($complaintId);
|
||||
}
|
||||
|
||||
public function delete($complaintId)
|
||||
{
|
||||
Complaint::destroy($complaintId);
|
||||
}
|
||||
|
||||
public function create(array $complaintDetails)
|
||||
{
|
||||
return Complaint::create($complaintDetails);
|
||||
}
|
||||
|
||||
public function update($complaintId, array $newDetails)
|
||||
{
|
||||
return Complaint::where('complaint_id', $complaintId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user