laravel-support/laravel-api-console

Auto-discovering Swagger-style API Console & Route Tracker for Laravel applications

Maintainers

Package info

gitlab.com/laravel-support/laravel-api-console

Issues

pkg:composer/laravel-support/laravel-api-console

Transparency log

Statistics

Installs: 123

Dependents: 0

Suggesters: 0

Stars: 0

v7.7.2 2026-08-03 14:16 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_trackers or crm_api_trackers) when multiple projects share the same database.
  • Connected Table Indicator: Displays active database table badge on /api-tracker and /api-console page 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), or toastr via .env.
  • Postman Exporter: Export your entire API collection as a Postman v2.1 JSON file.
  • Zero Configuration: Uses Laravel Package Auto-Discovery. Just composer require and php artisan migrate.
  • Security: Built-in HTTP Basic Auth protection via .env credentials (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 VariableDefault ValueDescription
API_CONSOLE_ENABLEDtrueEnable or disable package endpoints
API_CONSOLE_USERdeveloper@gmail.comUsername for /api-console (Interactive Specs)
API_CONSOLE_PASSdeveloper@4027Password for /api-console (Interactive Specs)
API_TRACKER_USERdeveloper@gmail.comUsername for /api-tracker (Admin Dashboard)
API_TRACKER_PASSdeveloper@4027Password for /api-tracker (Admin Dashboard)
API_CONSOLE_TOAST_DRIVERvanilla_toastToast driver: vanilla_toast, sweetalert, toastr
API_CONSOLE_TABLEapi_trackersPrimary database table name for this app
API_CONSOLE_ALLOWED_TABLES(empty)Comma-separated table list; enables UI table switcher dropdown when >1 table configured