New-OMIS/Modules/User/app/Repositories/RoleRepository.php

35 lines
596 B
PHP
Raw Normal View History

2024-04-09 12:15:26 +00:00
<?php
namespace Modules\User\Repositories;
use App\Models\Role;
class RoleRepository implements RoleInterface
{
public function findAll()
{
return Role::get();
}
public function getRoleById($roleId)
{
return Role::findOrFail($roleId);
}
public function delete($roleId)
{
Role::destroy($roleId);
}
public function create(array $roleDetails)
{
return Role::create($roleDetails);
}
public function update($roleId, array $newDetails)
{
return Role::whereId($roleId)->update($newDetails);
}
}