49 lines
812 B
PHP
49 lines
812 B
PHP
<?php
|
|
|
|
namespace Modules\Role\Repositories\Contracts;
|
|
|
|
use Modules\Role\Entities\Role;
|
|
|
|
interface RoleRepositoryInterface
|
|
{
|
|
/**
|
|
* Get all roles
|
|
*/
|
|
public function all();
|
|
|
|
/**
|
|
* Find role by ID
|
|
*/
|
|
public function find($id);
|
|
|
|
/**
|
|
* Find role by ID (alias for find)
|
|
*/
|
|
public function findById($id);
|
|
|
|
/**
|
|
* Create a new role
|
|
*/
|
|
public function create(array $data);
|
|
|
|
/**
|
|
* Update role
|
|
*/
|
|
public function update($id, array $data);
|
|
|
|
/**
|
|
* Delete role
|
|
*/
|
|
public function delete($id);
|
|
|
|
/**
|
|
* Get roles with permissions
|
|
*/
|
|
public function withPermissions($search = '');
|
|
|
|
/**
|
|
* Sync permissions for a role
|
|
*/
|
|
public function syncPermissions(Role $role, array $permissionIds);
|
|
}
|