Heera/Modules/Admin/app/Repositories/CasteRepository.php
2024-05-16 09:31:08 +05:45

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);
}
}