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

36 lines
680 B
PHP
Raw Normal View History

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