StocksNew/Modules/Admin/app/Repositories/EthnicityRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +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);
}
}