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

40 lines
743 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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');
}
}