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

36 lines
697 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Ethnicity;
class EthnicityRepository implements EthnicityInterface
{
public function findAll()
{
return Ethnicity::get();
}
public function getEthnicityById($ethnicityId)
{
return Ethnicity::findOrFail($ethnicityId);
}
public function delete($ethnicityId)
{
Ethnicity::destroy($ethnicityId);
}
public function create(array $ethnicityDetails)
{
return Ethnicity::create($ethnicityDetails);
}
public function update($ethnicityId, array $newDetails)
{
return Ethnicity::where('id', $ethnicityId)->update($newDetails);
}
}