Heera/Modules/Admin/app/Repositories/ProvinceRepository.php

36 lines
680 B
PHP
Raw Normal View History

2024-05-16 03:46:08 +00:00
<?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);
}
}