StocksNew/Modules/Admin/app/Repositories/CasteRepository.php

36 lines
629 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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);
}
}