- Updated AGENTS.md to streamline information on risk pool operations and agent account restrictions. - Introduced filtering options in AdminRiskPoolIndexController for active risk pools. - Refactored AdminRiskPoolLockLogIndexController to support grouping by ticket or entry. - Enhanced AdminRoleStoreController and AdminRoleUpdateController to prevent the use of reserved slugs for new roles. - Improved error messaging for role creation and updates to clarify reserved role restrictions. - Added new API routes for ticket item retrieval to improve admin functionalities.
25 lines
698 B
PHP
25 lines
698 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1\Admin\User;
|
|
|
|
use App\Models\AdminRole;
|
|
use App\Support\ApiResponse;
|
|
use Illuminate\Http\JsonResponse;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Support\AdminRoleApiPresenter;
|
|
final class AdminRoleIndexController extends Controller
|
|
{
|
|
public function __invoke(): JsonResponse
|
|
{
|
|
$roles = AdminRole::query()
|
|
->where('scope_type', AdminRole::SCOPE_SYSTEM)
|
|
->orderBy('sort_order')
|
|
->orderBy('id')
|
|
->get();
|
|
|
|
return ApiResponse::success([
|
|
'items' => $roles->map(static fn (AdminRole $role): array => AdminRoleApiPresenter::item($role))->values()->all(),
|
|
]);
|
|
}
|
|
}
|