Heera/Modules/Admin/app/Repositories/ProvinceRepository.php
2024-05-16 09:31:08 +05:45

36 lines
680 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Province;
class ProvinceRepository implements ProvinceInterface
{
public function findAll()
{
return Province::get();
}
public function getProvinceById($provinceId)
{
return Province::findOrFail($provinceId);
}
public function delete($provinceId)
{
Province::destroy($provinceId);
}
public function create(array $provinceDetails)
{
return Province::create($provinceDetails);
}
public function update($provinceId, array $newDetails)
{
return Province::where('id', $provinceId)->update($newDetails);
}
}