laravel-support / laravel-api-console
Auto-discovering Swagger-style API Console & Route Tracker for Laravel applications
Package info
gitlab.com/laravel-support/laravel-api-console
pkg:composer/laravel-support/laravel-api-console
Requires
- php: ^8.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
This package is not auto-updated.
Last update: 2026-08-03 08:47:12 UTC
README
A generic, unbranded Laravel Composer package that provides an interactive Swagger-style API Console, Route Tracker, and Postman Collection Exporter for any Laravel application.
Features
- Multi-Project Database Support: Configure custom project table names via
.env(API_CONSOLE_TABLE=driver_api_trackersorcrm_api_trackers) when multiple projects share the same database. - Connected Table Indicator: Displays active database table badge on
/api-trackerand/api-consolepage headers. - On-the-Fly Schema Creation: Automatically creates target database table schema if it does not exist during sync or migration commands without migration conflict issues in shared databases.
- Auto Route Discovery: Automatically scans all registered Laravel API routes (supporting single or multiple route files) and extracts path wildcards (e.g.
{id}). - Route Tracker: Screen-wise grouping, status management (
Active/Inactive), bulk screen tagging & status updates. - Configurable Toast Drivers: Switch notification toasts seamlessly between
vanilla_toast(vanilla-toast-js CDN),sweetalert(SweetAlert2), ortoastrvia.env. - Postman Exporter: Export your entire API collection as a Postman v2.1 JSON file.
- Zero Configuration: Uses Laravel Package Auto-Discovery. Just
composer requireandphp artisan migrate. - Security: Built-in HTTP Basic Auth protection via
.envcredentials (API_CONSOLE_USER/API_CONSOLE_PASS).
Installation Instructions
Step 1: Require the Package
Via Composer:
composer require laravel-support/laravel-api-console
Step 2: Run Database Migrations
php artisan migrate
Note for multi-project shared database setups: You can specify custom project table names via .env (API_CONSOLE_TABLE=driver_api_trackers) or using php artisan api:migrate --table=driver_api_trackers.
Available Commands
1. Sync Routes Command
Scans all Laravel API routes and updates the database table:
# Sync to default table
php artisan api:sync
# Sync to a specific project table
php artisan api:sync --table=driver_api_trackers
2. Migrate API Table Command
Safely creates/migrates an isolated tracker table schema for a specific project:
php artisan api:migrate --table=crm_api_trackers
3. Build & Minify Asset Build Files Command
Compiles and updates .min.js and .min.css build files after editing package CSS/JS:
php artisan api-console:build
Available Web Routes
Once installed, the following web endpoints are available:
- API Console (Interactive Documentation - filters out inactive routes):
http://your-app/api-console - API Tracker (Developer Admin Dashboard):
http://your-app/api-tracker - Postman Collection Export:
http://your-app/api-tracker/export-postman
Environment Configuration (.env)
Customize authentication credentials, toast drivers, and database table names per project in .env:
# API Console (Interactive Documentation Credentials)
API_CONSOLE_USER=developer@gmail.com
API_CONSOLE_PASS=developer@4027
# API Tracker (Developer Admin Dashboard Credentials)
API_TRACKER_USER=admin@gmail.com
API_TRACKER_PASS=admin@4027
# Notification Toast Driver (vanilla_toast, sweetalert, toastr)
API_CONSOLE_TOAST_DRIVER=vanilla_toast
# Custom Project Database Table (Multi-Project Shared DB Support)
# CRM: crm_api_trackers | Driver: driver_api_trackers | Customer: customer_api_trackers
API_CONSOLE_TABLE=api_trackers
# Optional: Enable UI Table Switcher for single project containing multiple module tables
API_CONSOLE_ALLOWED_TABLES=api_trackers,crm_api_trackers,driver_api_trackers,customer_api_trackers
.env Options Reference
| Environment Variable | Default Value | Description |
|---|---|---|
API_CONSOLE_ENABLED | true | Enable or disable package endpoints |
API_CONSOLE_USER | developer@gmail.com | Username for /api-console (Interactive Specs) |
API_CONSOLE_PASS | developer@4027 | Password for /api-console (Interactive Specs) |
API_TRACKER_USER | developer@gmail.com | Username for /api-tracker (Admin Dashboard) |
API_TRACKER_PASS | developer@4027 | Password for /api-tracker (Admin Dashboard) |
API_CONSOLE_TOAST_DRIVER | vanilla_toast | Toast driver: vanilla_toast, sweetalert, toastr |
API_CONSOLE_TABLE | api_trackers | Primary database table name for this app |
API_CONSOLE_ALLOWED_TABLES | (empty) | Comma-separated table list; enables UI table switcher dropdown when >1 table configured |