36 lines
680 B
PHP
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);
|
||
|
}
|
||
|
|
||
|
}
|