StocksNew/Modules/Admin/app/Repositories/DistrictRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

36 lines
680 B
PHP

<?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);
}
}