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

36 lines
731 B
PHP
Raw Normal View History

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