Увійти Реєстрація
Блог Серії
Кар'єра
Вакансії Компанії
Навчання
Документація Співбесіди Тестування Відео
Екосистема
Пакети Ресурси Проєкти Інструменти Події
Інше
Про нас Реклама

Laravel Api To Postman

andreaselia/laravel-api-to-postman
v2.3.0 13 1,054 738.4k 17 березня 2026
На GitHub

Автоматично генерує колекцію Postman з вашого Laravel API.

13

Поділитись

README

Laravel API to Postman Header

Latest Stable Version

Laravel API to Postman

This package allows you to automatically generate a Postman collection based on your API routes. It also provides basic configuration and support for bearer auth tokens and basic auth for routes behind an auth middleware.

For POST and PUT requests that utilizes a FormRequest, you can optionally scaffold the request, and publish rules in raw or human readable format.

Postman Schema

The generator works for the latest version of the Postman Schema at the time of publication (v2.1.0).

Installation

Install the package:

composer require andreaselia/laravel-api-to-postman

Publish the config file:

php artisan vendor:publish --provider="AndreasElia\PostmanGenerator\PostmanGeneratorServiceProvider"

Configuration

You can modify any of the api-postman.php config values to suit your export requirements.

Click here to view the config attributes.

Usage

The collection is saved in the postman directory of the disk configured by the disk option (the local disk by default, which is storage/app/private on Laravel 11+ and storage/app on older versions). The full path is printed once the export has finished.

To use the command simply run:

php artisan export:postman

The following usage will generate routes with the bearer token specified.

php artisan export:postman --bearer="1|XXNKXXqJjfzG8XXSvXX1Q4pxxnkXmp8tT8TXXKXX"

The following usage will generate routes with the basic auth specified.

php artisan export:postman --basic="username:password123"

If both auths are specified, bearer will be favored.

The auth header is only added to routes that use the middleware configured by the auth_middleware option (auth:api by default), or any auth / auth:* middleware such as auth:sanctum.

Instead of passing an option, you can also configure the authentication in your .env file. Options passed to the command take precedence over these values.

POSTMAN_EXPORT_AUTH_METHOD=bearer # or basic
POSTMAN_EXPORT_AUTH_TOKEN=your-token

If a method is set without a token, the requests will use the {{token}} collection variable, which you can fill in from within Postman.

Examples

This is with the default configuration and a bearer token passed in:

php artisan export:postman --bearer=123456789

Contributing

You're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.

Читати в документації

Коментарі

Увійдіть, щоб залишити коментар

Будьте першим, хто залишить коментар!

Схожі пакети

Filament

filament/filament

Найпопулярніша адмін-панель для Laravel: ресурси, таблиці, форми та дашборди описуються PHP-класами поверх Livewire, Alpine і Tailwind. Замінює рутину CRUD-інтерфейсів декларативною конфігурацією.

31,852 v5.7.6 10

Cms

statamic/cms

Основний пакет системи керування вмістом Statamic.

4,911 v6.38.0 13 29

Platform

orchidsoftware/platform

Платформа для розробки back-office додатків, адмін-панелей та CMS для Laravel-застосунків.

4,800 14.53.0 13 19

Twill

area17/twill

Twill — це інструментарій CMS з відкритим кодом для Laravel, який допомагає розробникам швидко створювати інтуїтивну, потужну та гнучку адмін-консоль.

3,976 3.6.0 13 14

Crud

laravel-backpack/crud

Швидко створюй адміністративні інтерфейси за допомогою Laravel, Bootstrap та JavaScript.

3,376 7.1.22 13 13

Blueprint

laravel-shift/blueprint

Виразний інструмент генерації коду, який написаний зрозумілою для людини мовою.

3,112 v2.13.0 12 10