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

36 lines
697 B
PHP
Raw Normal View History

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