36 lines
731 B
PHP
36 lines
731 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\Repositories;
|
|
|
|
use Modules\Admin\Models\Nationality;
|
|
|
|
|
|
class NationalityRepository implements NationalityInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return Nationality::get();
|
|
}
|
|
|
|
public function getNationalityById($nationalityId)
|
|
{
|
|
return Nationality::findOrFail($nationalityId);
|
|
}
|
|
|
|
public function delete($nationalityId)
|
|
{
|
|
Nationality::destroy($nationalityId);
|
|
}
|
|
|
|
public function create(array $nationalityDetails)
|
|
{
|
|
return Nationality::create($nationalityDetails);
|
|
}
|
|
|
|
public function update($nationalityId, array $newDetails)
|
|
{
|
|
return Nationality::where('id', $nationalityId)->update($newDetails);
|
|
}
|
|
|
|
}
|