first commit
This commit is contained in:
35
Modules/Admin/app/Repositories/CityRepository.php
Normal file
35
Modules/Admin/app/Repositories/CityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user