40 lines
730 B
PHP
40 lines
730 B
PHP
<?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');
|
|
}
|
|
|
|
}
|