PHPackages                             sajidifti/laravel-command-center - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. sajidifti/laravel-command-center

ActiveLibrary[Admin Panels](/categories/admin)

sajidifti/laravel-command-center
================================

Laravel Command Center - A database-independent command center for Laravel applications with emergency access capabilities

v1.2.0(7mo ago)03MITBladePHP ^8.3

Since Nov 20Pushed 7mo agoCompare

[ Source](https://github.com/sajidifti/laravel-command-center)[ Packagist](https://packagist.org/packages/sajidifti/laravel-command-center)[ RSS](/packages/sajidifti-laravel-command-center/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Laravel Laravel Command Center
==============================

[](#laravel-laravel-command-center)

[![Latest Version on Packagist](https://camo.githubusercontent.com/85a5605366ba2b1ead5886e2833d7106373e1891e956011150ed2dbad207bf85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616a6964696674692f6c61726176656c2d636f6d6d616e642d63656e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sajidifti/laravel-command-center)[![Total Downloads](https://camo.githubusercontent.com/15d7735aef576c21a39baea379bccf901c976da90c9365645d44969b440ed253/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616a6964696674692f6c61726176656c2d636f6d6d616e642d63656e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sajidifti/laravel-command-center)

A database-independent Laravel Command Center for Laravel applications that works even when your database is down. Perfect for emergency maintenance, system management, and troubleshooting.

Features
--------

[](#features)

- ✅ **Zero Database Dependency** - Works even when database is unavailable
- ✅ **File-Based Sessions** - Independent session management
- ✅ **Prebuilt Assets** - No NPM/Vite required
- ✅ **Emergency Access** - Manage your app during outages
- ✅ **Artisan Commands** - Execute commands via web interface
- ✅ **Environment Management** - Edit .env variables through UI
- ✅ **Maintenance Mode** - Toggle with bypass URL generation
- ✅ **System Information** - View PHP, Laravel, and server details
- ✅ **Standalone Auth** - Uses .env credentials, no database needed

Installation
------------

[](#installation)

### Option 1: Install from Packagist (Production)

[](#option-1-install-from-packagist-production)

For production use, install the package from Packagist:

```
composer require sajidifti/laravel-command-center
```

Then run the installation command:

```
php artisan command-center:install
```

The installer will guide you through an interactive setup process, asking you to:

- Publish configuration file (default: Yes)
- Publish compiled assets (default: Yes)
- Add environment variables to `.env` and `.env.example` (default: Yes)

For each environment variable, you'll be prompted with secure defaults:

- **Route Prefix**: Includes a randomly generated secret path
- **Username**: Default is `admin`
- **Password**: Randomly generated 16-character password
- **Session Lifetime**: Default is `120` minutes

### Option 2: Install for Local Development

[](#option-2-install-for-local-development)

For local development or contributing to the package:

1. **Clone or add the package to your Laravel project**:

```
# Create packages directory if it doesn't exist
mkdir -p packages/sajidifti

# Clone the repository
cd packages/sajidifti
git clone https://github.com/sajidifti/laravel-command-center.git
```

2. **Add the local repository to your root `composer.json`**:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "./packages/sajidifti/laravel-command-center",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
        "sajidifti/laravel-command-center": "@dev"
    }
}
```

3. **Install the package**:

```
composer require sajidifti/laravel-command-center @dev
```

4. **Run the installation command**:

```
php artisan command-center:install
```

### Accessing the Command Center

[](#accessing-the-command-center)

After installation, the command will display your access URL. Navigate to the route prefix you configured (e.g., `https://yourdomain.com/command-center/somesecret`) and login with the credentials you set during installation.

**Security Note:** Your route prefix includes a random secret path for security. Keep this URL private and use HTTPS in production.

Available Commands
------------------

[](#available-commands)

### `command-center:install`

[](#command-centerinstall)

Interactive installation wizard that guides you through setting up the Laravel Command Center.

#### Interactive Mode (Default)

[](#interactive-mode-default)

Simply run the command and answer the prompts:

```
php artisan command-center:install
```

You'll be asked:

1. **Publish configuration file?** (yes/no) \[yes\]
2. **Publish compiled assets (CSS/JS)?** (yes/no) \[yes\]
3. **Add environment variables to .env (and .env.example)?** (yes/no) \[yes\]

If you choose to add environment variables, you'll be prompted for:

- **Route Prefix**: Default includes a random secret (e.g., `command-center/somesecret`)
- **Username**: Default is `admin`
- **Password**: Hidden input, defaults to a random 16-character string
- **Session Lifetime**: Default is `120` minutes

#### Flag-Based Mode

[](#flag-based-mode)

Skip interactive prompts by using flags to install only specific components:

```
# Publish only configuration
php artisan command-center:install --only-config

# Publish only assets
php artisan command-center:install --only-assets

# Only add environment variables
php artisan command-center:install --only-env
```

**Note:** The `--only-*` flags are mutually exclusive. When you use one, only that specific component will be installed. To install multiple components, run the command multiple times or use interactive mode.

#### Full Installation Mode (Non-Interactive)

[](#full-installation-mode-non-interactive)

For automated deployments or CI/CD pipelines:

```
php artisan command-center:install --full
```

This will:

- Publish configuration file
- Publish compiled assets
- Add environment variables with secure random defaults
- No user interaction required

#### What Happens When You Skip Steps

[](#what-happens-when-you-skip-steps)

If you answer "no" to any step, the installer will show you manual instructions:

**Skipped Config:**

```
⚠ Configuration not published
To publish the configuration file manually, run:
  php artisan vendor:publish --tag=command-center-config

```

**Skipped Assets:**

```
⚠ Assets not published
To publish the compiled assets manually, run:
  php artisan vendor:publish --tag=command-center-assets

```

**Skipped Environment Variables:**

```
⚠ Environment variables not added
Add the following keys to your .env file:

  LARAVEL_COMMAND_CENTER_ROUTE_PREFIX=command-center/your-secret-path
  LARAVEL_COMMAND_CENTER_USERNAME=admin
  LARAVEL_COMMAND_CENTER_PASSWORD=your-secure-password
  LARAVEL_COMMAND_CENTER_SESSION_LIFETIME=120

```

### `command-center:clean-sessions`

[](#command-centerclean-sessions)

Cleans up expired session files from the command center's file-based session storage.

```
php artisan command-center:clean-sessions
```

**What it does**:

- Scans `storage/framework/management_sessions/`
- Removes expired session files
- Reports number of sessions cleaned

**When to use**:

- Periodically to free up disk space
- If experiencing session-related issues
- Can be added to Laravel's scheduler for automatic cleanup

### Manual Publishing (Advanced)

[](#manual-publishing-advanced)

You can also manually publish specific components using Laravel's vendor:publish command:

```
# Publish only configuration
php artisan vendor:publish --tag=command-center-config

# Publish only assets
php artisan vendor:publish --tag=command-center-assets

# Force publish (overwrites existing files)
php artisan vendor:publish --tag=command-center-assets --force
```

Configuration
-------------

[](#configuration)

The package is configured via `config/command-center.php`. After installation, you can customize various aspects of the Command Center.

### Basic Configuration

[](#basic-configuration)

```
return [
    // Route prefix for accessing the Command Center
    'route_prefix' => env('LARAVEL_COMMAND_CENTER_ROUTE_PREFIX', 'command-center/secret'),

    // Authentication credentials
    'username' => env('LARAVEL_COMMAND_CENTER_USERNAME', 'admin'),
    'password' => env('LARAVEL_COMMAND_CENTER_PASSWORD', 'password'),

    // Session configuration
    'session' => [
        'lifetime' => env('LARAVEL_COMMAND_CENTER_SESSION_LIFETIME', 120),  // minutes
        'path' => storage_path('framework/management_sessions'),
        'cookie' => 'laravel_command_center_session_id',
        'gc_probability' => 2,  // 2% chance of garbage collection
    ],
];
```

### Customizable Features

[](#customizable-features)

The configuration file includes several customizable sections:

#### System Information Items

[](#system-information-items)

Customize which system information is displayed on the dashboard:

```
'system_info_items' => [
    [
        'key' => 'php_version',
        'label' => 'PHP Version',
        'icon' => 'heroicon-o-code-bracket',
        'value' => fn() => PHP_VERSION,
    ],
    // Add your own custom system info items
],
```

#### Environment Settings Categories

[](#environment-settings-categories)

Define which environment variables are editable through the UI:

```
'env_settings_categories' => [
    [
        'key' => 'app',
        'name' => 'Application Settings',
        'icon' => 'heroicon-o-cog-6-tooth',
        'fields' => [
            [
                'key' => 'APP_NAME',
                'label' => 'Application Name',
                'type' => 'text'
            ],
            // Add more fields
        ],
    ],
    // Add your own custom categories
],
```

#### Command Sections

[](#command-sections)

Organize and customize available Artisan commands:

```
'command_sections' => [
    [
        'name' => 'Optimization Commands',
        'icon' => 'heroicon-o-bolt',
        'color' => 'blue',
        'commands' => [
            [
                'title' => 'Optimize Application',
                'description' => 'optimize',
                'command' => 'optimize',
                'color' => 'blue',
            ],
            // Add more commands
        ],
    ],
    // Add your own custom sections
],
```

#### Allowed Commands

[](#allowed-commands)

For security, only whitelisted commands can be executed:

```
'allowed_commands' => [
    'optimize',
    'cache:clear',
    'migrate',
    // Add your custom commands here
],
```

> **Note:** Any command you add to `command_sections` must also be added to `allowed_commands` for security validation.

Usage
-----

[](#usage)

### Accessing the Command Center

[](#accessing-the-command-center-1)

1. Navigate to your configured route prefix (e.g., `https://yourdomain.com/command-center/somesecret`)
2. Login with credentials from `.env`
3. Use the interface to manage your application

### Features Available

[](#features-available)

#### System Information

[](#system-information)

- PHP Version
- Laravel Version
- Environment Mode
- Debug Status
- Database Connection

#### Artisan Commands

[](#artisan-commands)

- Optimization commands (cache, config, routes)
- Clear cache commands
- Database migrations
- Queue management
- Custom commands

#### Environment Management

[](#environment-management)

- Edit .env variables through secure UI
- Grouped by category (App, Database, Mail, etc.)
- Safe updates with confirmation

#### Maintenance Mode

[](#maintenance-mode)

- Toggle maintenance mode on/off
- Generate secure bypass URLs
- Copy bypass URL to clipboard

How It Works
------------

[](#how-it-works)

### Database Independence

[](#database-independence)

The Laravel Command Center is completely independent of your application's database:

1. **File-Based Sessions**: Uses its own session storage in `storage/framework/management_sessions/`
2. **No Web Middleware**: Bypasses Laravel's database-dependent middleware
3. **Standalone Routes**: Loads without web middleware group
4. **No Database Queries**: Authentication uses .env, not database

### Security Features

[](#security-features)

- ✅ Customizable route prefix
- ✅ Environment-based credentials
- ✅ File-based authentication
- ✅ HTTPOnly session cookies
- ✅ CSRF protection
- ✅ Secure password handling

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.x or 12.x
- Write permissions for `storage/framework/management_sessions/`

Prebuilt Assets
---------------

[](#prebuilt-assets)

This package ships with prebuilt Tailwind CSS v4 in the `public` directory, so consumers do not need Node.js or NPM to use the package in production.

**Development / Rebuilding Assets**

If you need to modify the frontend and rebuild the assets, the package includes a Vite + Tailwind v4 build setup. From the package root run:

```
cd packages/sajidifti/laravel-command-center # or cd vendor/sajidifti/laravel-command-center
npm install
npm run build
```

The build writes compiled JS/CSS into the package `public` directory. After building, publish the package assets into your application with:

```
php artisan command-center:install --only-assets
# Or use Laravel's vendor:publish command
php artisan vendor:publish --tag=command-center-assets --force
```

**Notes**:

- The package `package.json` and build config are intended for package maintainers
- Built assets should be committed to the package `public` folder so consumers don't need a build step
- The build outputs are placed in `public/js` and `public/css` inside the package
- Assets are published to `public/vendor/laravel-command-center/` by the service provider

Troubleshooting
---------------

[](#troubleshooting)

### Command Center Not Loading

[](#command-center-not-loading)

1. Check that route prefix is correct in `.env`
2. Clear config cache: `php artisan config:clear`
3. Verify storage permissions: `storage/framework/management_sessions/` needs to be writable

### Session Issues

[](#session-issues)

```
# Clear command center sessions
php artisan command-center:clean-sessions
```

### Assets Not Loading

[](#assets-not-loading)

```
# Republish assets using the install command
php artisan command-center:install --only-assets

# Or use vendor:publish with force flag
php artisan vendor:publish --tag=command-center-assets --force
```

### Cannot Access During Database Outage

[](#cannot-access-during-database-outage)

This is the main feature! The command center should work even when:

- Database is down
- Tables don't exist
- Connection fails
- During migrations

If it's not working, check your view composers aren't querying the database.

Advanced Configuration
----------------------

[](#advanced-configuration)

### Custom Session Path

[](#custom-session-path)

```
// config/command-center.php
'session' => [
    'path' => storage_path('custom/session/path'),
],
```

### Custom Middleware

[](#custom-middleware)

Register additional middleware in `bootstrap/app.php`:

```
$middleware->alias([
    'command-center.custom' => \App\Http\Middleware\CustomCommandCenterMiddleware::class,
]);
```

### Scheduled Session Cleanup

[](#scheduled-session-cleanup)

Add to your `routes/console.php` or scheduler:

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('command-center:clean-sessions')->daily();
```

Security Best Practices
-----------------------

[](#security-best-practices)

1. **Change Default Route**: Use a unique, hard-to-guess route prefix
2. **Strong Credentials**: Use strong username and password
3. **HTTPS Only**: Always use HTTPS in production

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Credits
-------

[](#credits)

- [Md. Sajid Anam Ifti](https://github.com/sajidifti)
- [All Contributors](../../contributors)

Support
-------

[](#support)

For support, email  or open an issue on GitHub.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance63

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

226d ago

PHP version history (2 changes)1.0.0PHP ^8.2

v1.2.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b218928ed00712824836d18a026956dcabe2cf69bda64e0d011dfd623d75f14c?d=identicon)[sajidifti](/maintainers/sajidifti)

---

Top Contributors

[![sajidifti](https://avatars.githubusercontent.com/u/74966524?v=4)](https://github.com/sajidifti "sajidifti (10 commits)")

---

Tags

composer-packagelaravel-packagepackagistphplaravelmanagementadminemergencycommand-centerdatabase-independent

### Embed Badge

![Health badge](/badges/sajidifti-laravel-command-center/health.svg)

```
[![Health](https://phpackages.com/badges/sajidifti-laravel-command-center/health.svg)](https://phpackages.com/packages/sajidifti-laravel-command-center)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[sebastienheyd/boilerplate

Laravel Boilerplate based on AdminLTE 3 with blade components, user management, roles, permissions, logs viewer, ...

29420.2k3](/packages/sebastienheyd-boilerplate)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.9k26](/packages/slowlyo-owl-admin)[a2insights/filament-saas

Filament Saas for A2Insights

171.7k](/packages/a2insights-filament-saas)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
