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

36 lines
612 B
PHP

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