35 lines
596 B
PHP
35 lines
596 B
PHP
|
<?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);
|
||
|
}
|
||
|
|
||
|
}
|