Adding route to get all roles unpaginated

parent df68e512
......@@ -29,6 +29,11 @@ class RoleController extends Controller
$this->permissions = $permissions;
}
public function all()
{
return RoleTransformer::collection($this->role->all());
}
public function index(Request $request)
{
return RoleTransformer::collection($this->role->serverPaginationFilteringFor($request));
......
......@@ -13,6 +13,11 @@ $router->group(['prefix' => '/user', 'middleware' => ['api.token', 'auth.admin']
'uses' => 'RoleController@index',
'middleware' => 'token-can:user.roles.index',
]);
$router->get('all', [
'as' => 'api.user.role.all',
'uses' => 'RoleController@all',
'middleware' => 'token-can:user.roles.index',
]);
$router->post('/', [
'as' => 'api.user.role.store',
'uses' => 'RoleController@store',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment