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