first commit
This commit is contained in:
35
Modules/Admin/app/Repositories/DistrictRepository.php
Normal file
35
Modules/Admin/app/Repositories/DistrictRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\District;
|
||||
|
||||
|
||||
class DistrictRepository implements DistrictInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return District::get();
|
||||
}
|
||||
|
||||
public function getDistrictById($districtId)
|
||||
{
|
||||
return District::findOrFail($districtId);
|
||||
}
|
||||
|
||||
public function delete($districtId)
|
||||
{
|
||||
District::destroy($districtId);
|
||||
}
|
||||
|
||||
public function create(array $districtDetails)
|
||||
{
|
||||
return District::create($districtDetails);
|
||||
}
|
||||
|
||||
public function update($districtId, array $newDetails)
|
||||
{
|
||||
return District::where('id', $districtId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user