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

36 lines
612 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\City;
class CityRepository implements CityInterface
{
public function findAll()
{
return City::get();
}
public function getCityById($cityId)
{
return City::findOrFail($cityId);
}
public function delete($cityId)
{
City::destroy($cityId);
}
public function create(array $cityDetails)
{
return City::create($cityDetails);
}
public function update($cityId, array $newDetails)
{
return City::where('id', $cityId)->update($newDetails);
}
}