Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Web Console Laravel Package

alkhachatryan/laravel-web-console

Laravel Web Console adds a browser-based Artisan console to your Laravel app, letting authorized users run commands and view output without SSH. It includes configurable access controls, command history, and a responsive terminal-style interface for quick debugging and maintenance.

View on GitHub
Deep Wiki
Context7

Getting Started

Install the package with Composer. It is archived (last release October 2020), so treat installation as a compatibility exercise first:

composer require alkhachatryan/laravel-web-console

Laravel 5.5+ should auto-discover Alkhachatryan\LaravelWebConsole\LaravelWebConsoleServiceProvider. On older versions, register the provider manually in config/app.php. Then publish the package config and frontend assets:

php artisan vendor:publish --provider="Alkhachatryan\LaravelWebConsole\LaravelWebConsoleServiceProvider"

Open config/web-console.php first. It controls the route/path, middleware, and authorization behavior. The default setup typically exposes a /web-console route behind web and auth middleware, but you should confirm the exact keys in your published config rather than assuming defaults.

Before visiting the console, define the authorization gate in app/Providers/AuthServiceProvider.php:

use Illuminate\Support\Facades\Gate;

public function boot()
{
    Gate::define('viewWebConsole', function ($user) {
        return $user->is_admin; // or an explicit email/role check
    });
}

Then visit /web-console (or your configured path) as an authenticated user who passes the gate.

The first practical use case is read-only inspection: run route:list, migrate:status, config:show (where available), cache:clear, or queue:failed from the browser instead of SSHing into a staging box. It is best treated as an internal admin convenience, not a production shell.

Implementation Patterns

Lock it to an admin surface. Put the console behind your existing admin middleware stack and gate, and link to it from an admin navigation area. A typical config override:

// config/web-console.php
return [
    'route' => 'admin/web-console',
    'middleware' => ['web', 'auth', 'can:viewWebConsole'],
];

Confirm the actual config keys in the published file; the important part is that both authentication and authorization are enforced at the route level, not only in the UI.

Use it for discrete Artisan operations. The console executes Artisan commands, not shell commands. Good day-to-day candidates are:

  • migrate, migrate:rollback, migrate:status
  • db:seed --class=...
  • cache:clear, config:clear, route:clear, view:clear
  • route:list, event:list, queue:failed
  • make:model, make:controller, make:migration

Avoid anything interactive or long-running: tinker, queue:work, serve, and large migrations belong in a real terminal.

Add an audit trail. Wrap the console route with custom middleware that logs the authenticated user, timestamp, IP, and command payload. Since the package ultimately receives a command string and returns output, logging at the middleware/controller boundary gives you accountability without modifying vendor code.

Restrict by environment and network. For local and staging, a simple gate is enough. For any shared environment, combine the gate with an IP allowlist or VPN-only access. A common pattern is to return false from the gate when app()->environment('production'), and enable it only for named operators.

Gate::define('viewWebConsole', function ($user) {
    return app()->environment(['local', 'staging'])
        && $user->hasRole('operator');
});

Publish and customize the views sparingly. If you need to add a warning banner, command history, or a link back to your admin dashboard, publish the package views and override them. Keep customizations minimal because the package is unmaintained and upstream updates are unlikely.

Use it as a diagnostic companion, not a deployment tool. The strongest workflow is: deploy through CI, then use the web console for post-deploy checks such as migrate:status, config:clear, route:list, and cache warm-up verification. Keep destructive or schema-changing operations in a controlled CLI or CI pipeline.

Gotchas and Tips

  • Archived and unmaintained. Last release was October 2020. Expect friction on Laravel 9+ and PHP 8+. Check composer.json constraints before installing; if Composer blocks the install, prefer a fork or a maintained alternative over --ignore-platform-reqs in production.
  • Artisan only, not a shell. Commands like ls, cd, git status, php -v, and composer install will not work. The console runs through Laravel's Artisan layer.
  • Interactive and long-running commands hang. tinker, queue:work, serve, and commands that wait for input will block the HTTP request until PHP or the web server times out. Use a real terminal for those.
  • Security is the dominant risk. This package exposes command execution through the browser. Never leave it publicly reachable. Require authentication, require the gate, enforce HTTPS, and consider IP allowlisting. Review the published config for any permissive defaults before deploying.
  • CSRF and middleware ordering. The console's POST endpoint depends on the web middleware group for session and CSRF handling. If you replace middleware, keep web or manually ensure the CSRF token is sent. In browser dev tools, a 419 response usually means CSRF/session configuration is wrong.
  • Gate not defined means access denied. If the viewWebConsole gate is missing or returns a non-boolean, expect a 403. Verify with php artisan route:list and by temporarily logging inside the gate closure.
  • Blank console usually means unpublished or missing assets. Run the vendor:publish command again and check that the package's public assets exist under public/vendor/.... Also check the browser network tab for 404s on JS/CSS.
  • Route and config caching. After changing config/web-console.php, run php artisan config:clear. If routes are cached, re-cache after any route-related config change, and confirm the console route appears in route:list.
  • Output formatting is limited. ANSI colors, progress bars, and very large outputs may render poorly or be truncated. Prefer commands with concise output, and use --no-ansi where supported.
  • No confirmation prompts. Destructive commands execute immediately. Build the habit of running read-only commands first, taking a database backup before migrate or db:wipe, and avoiding destructive commands from the browser on shared environments.
  • Timeouts on heavy operations. Large migrations or seeders can exceed max_execution_time or your reverse proxy timeout, leaving the browser request open with no feedback. Use the CLI for anything that may take more than a few seconds.
  • Extension points. The practical customization surface is the published config (route, middleware, authorization), published views/assets, and custom middleware around the route. Avoid patching vendor files directly; if you need deeper changes, fork the package and pin your fork in composer.json.
  • Debugging checklist. Check storage/logs/laravel.log, inspect the AJAX request/response in the browser network tab, run php artisan route:list | grep -i console, and verify the gate with a quick Gate::allows('viewWebConsole') check in a test or Tinker session.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core