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

40 lines
730 B
PHP
Raw Normal View History

2024-04-16 11:14:18 +00:00
<?php
namespace Modules\PMS\Repositories;
use Modules\PMS\Models\Client;
class ClientRepository implements ClientInterface
{
public function findAll()
{
return Client::paginate(20);
}
public function getClientById($ClientId)
{
return Client::findOrFail($ClientId);
}
public function delete($ClientId)
{
Client::destroy($ClientId);
}
public function create($ClientDetails)
{
return Client::create($ClientDetails);
}
public function update($ClientId, array $newDetails)
{
return Client::whereId($ClientId)->update($newDetails);
}
public function pluck()
{
return Client::pluck('client_name', 'id');
}
}