New-OMIS/Modules/User/app/Repositories/RoleRepository.php
2024-04-11 16:44:09 +05:45

35 lines
610 B
PHP

<?php
namespace Modules\User\Repositories;
use Spatie\Permission\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);
}
}