স্কিপ করে মূল কন্টেন্ট এ যান

API Tester

super-admin-org/api-tester lists your API routes and sends requests to them from the admin panel, optionally logged in as a given user, and shows the status, headers, cookies and the formatted response.

Packagesuper-admin-org/api-tester
Admin URL/admin/api-tester
MenuApi tester
Permissionext.api-tester (path /api-tester*)

Installation​

composer require super-admin-org/api-tester
php artisan vendor:publish --tag=api-tester # Prism syntax highlighter
php artisan admin:import api-tester

Laravel 11 and newer do not load routes/api.php until you enable it:

php artisan install:api

Without API routes the Routes list is empty.

Using it​

  1. Click a route on the left (filter with the search box). Its method and URI fill the request form; parameters documented with @SWG\Parameter annotations are added automatically.
  2. Login as: a user id (or what your user_retriever accepts). The request runs as that user on the configured guard.
  3. Add param adds key/value pairs; the upload icon switches a value to a file.
  4. Send. The response panel shows the status, the body (JSON pretty-printed), headers and cookies.

Requests are handled inside the application (no real HTTP call), so they skip the network and see the same configuration as the panel.

Configuration​

'extensions' => [
'api-tester' => [
'prefix' => 'api', // routes whose URI starts with this are listed
'guard' => 'api', // guard used for "Login as"; Laravel 11+ with Sanctum: 'sanctum'
// Optional: resolve the user for "Login as". Use a static method, not a closure,
// so that `php artisan config:cache` keeps working.
'user_retriever' => [\App\Support\ApiTesterUsers::class, 'find'],
],
],

Compatibility​

LaravelPHPState
8 – 138.0+Known issue: if an API controller method has a doc comment, the page fails with "Call to undefined function array_get()" (the helper was removed in Laravel 6). A fix is planned.
Powerful tool

"Login as" lets the user act as any API user. Grant ext.api-tester only to trusted administrators and disable the extension in production ('enable' => false).