36 lines
748 B
PHP
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);
|
|
}
|
|
|
|
}
|