36 lines
629 B
PHP
36 lines
629 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Admin\Repositories;
|
||
|
|
||
|
use Modules\Admin\Models\Caste;
|
||
|
|
||
|
|
||
|
class CasteRepository implements CasteInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return Caste::get();
|
||
|
}
|
||
|
|
||
|
public function getCasteById($casteId)
|
||
|
{
|
||
|
return Caste::findOrFail($casteId);
|
||
|
}
|
||
|
|
||
|
public function delete($casteId)
|
||
|
{
|
||
|
Caste::destroy($casteId);
|
||
|
}
|
||
|
|
||
|
public function create(array $casteDetails)
|
||
|
{
|
||
|
return Caste::create($casteDetails);
|
||
|
}
|
||
|
|
||
|
public function update($casteId, array $newDetails)
|
||
|
{
|
||
|
return Caste::where('id', $casteId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|