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