first commit
This commit is contained in:
35
Modules/Admin/app/Repositories/MunicipalityRepository.php
Normal file
35
Modules/Admin/app/Repositories/MunicipalityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user