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

36 lines
748 B
PHP
Raw Normal View History

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