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