StocksNew/Modules/Admin/app/Repositories/CountryRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

40 lines
743 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);
}
public function pluck(){
return Country::pluck('name','id');
}
}