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

36 lines
663 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Country;
class CountryRepository implements CountryInterface
{
public function findAll()
{
return Country::get();
}
public function getCountryById($countryId)
{
return Country::findOrFail($countryId);
}
public function delete($countryId)
{
Country::destroy($countryId);
}
public function create(array $countryDetails)
{
return Country::create($countryDetails);
}
public function update($countryId, array $newDetails)
{
return Country::where('id', $countryId)->update($newDetails);
}
}