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

36 lines
748 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Municipality;
class MunicipalityRepository implements MunicipalityInterface
{
public function findAll()
{
return Municipality::get();
}
public function getMunicipalityById($municipalityId)
{
return Municipality::findOrFail($municipalityId);
}
public function delete($municipalityId)
{
Municipality::destroy($municipalityId);
}
public function create(array $municipalityDetails)
{
return Municipality::create($municipalityDetails);
}
public function update($municipalityId, array $newDetails)
{
return Municipality::where('id', $municipalityId)->update($newDetails);
}
}