work on user role module
This commit is contained in:
34
Modules/User/app/Repositories/RoleRepository.php
Normal file
34
Modules/User/app/Repositories/RoleRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user