tanbhirhossain/laravel-live-terminal
Composer 安装命令:
composer require tanbhirhossain/laravel-live-terminal
包简介
A simple and secure web-based terminal to run Laravel Artisan commands.
README 文档
README
A beautiful and secure web-based terminal to run whitelisted Laravel Artisan commands directly from your browser.
⚠️ Critical Security Warning
This package allows you to execute shell commands on your server from a web interface. If not properly secured, it can expose your entire application and server to catastrophic vulnerabilities.
- NEVER deploy this to a production environment with weak or no authentication.
- ALWAYS protect the terminal route with middleware that strictly limits access to trusted administrators.
- BE CAREFUL with the commands you add to the
allowed_commandswhitelist. Do not allow commands that can write arbitrary files or execute arbitrary code.
You are responsible for securing this tool within your application.
Installation
You can install the package via Composer:
composer require tanbhirhossain/laravel-live-terminal Next, you must publish the configuration file. This is a required step to manage your command whitelist and security settings. code Bash php artisan vendor:publish --provider="Tanbhirhossain\LaravelLiveTerminal\TerminalServiceProvider" --tag="terminal-config" This will create a config/terminal.php file in your project. Usage Make sure you have a working authentication system (e.g., Laravel Breeze, Jetstream). By default, the terminal is available at http://your-app.test/live-terminal. You must be logged in to access this route, as defined by the default auth middleware in the config. Once you access the URL, you will see the terminal interface and can begin running commands that you have whitelisted in the configuration file. Configuration Customization is done in the config/terminal.php file. Let's break down each option. PHP Executable Path The package needs to know where your server's PHP executable is located. It tries to find it automatically, but on some server configurations (especially on Windows with WAMP/XAMPP), this can fail. If your commands are not working, you can set the path manually. code PHP // config/terminal.php 'php_path' => null, // Example for Windows: // 'php_path' => 'C:\php\php.exe', // Example for Linux (usually found automatically): // 'php_path' => '/usr/bin/php', Allowed Commands (Whitelist) This is your primary security control. It is an array of base commands that are allowed to run. The terminal will reject any command not on this list. code PHP // config/terminal.php 'allowed_commands' => [ 'list', 'help', '--version', 'route:list', 'view:clear', 'config:clear', 'cache:clear', 'migrate', 'migrate:status', 'schedule:list', // Add your own safe commands here. For example: 'queue:failed', 'db:seed', ], Note: The check is performed on the base command. This means if route:list is allowed, a user can also run route:list --json --path=api. Be mindful of the commands and options you enable. Route Middleware This is your primary security gate. It's an array of middleware that will be applied to the terminal's routes. It is strongly recommended to add your own middleware to restrict access to only administrators. code PHP // config/terminal.php 'middleware' => ['web', 'auth'], // Recommended example for a project with an 'isAdmin' middleware: // 'middleware' => ['web', 'auth', 'isAdmin'], // Example for a project using roles/permissions (e.g., Spatie's package): // 'middleware' => ['web', 'auth', 'role:super-admin'], Route Path This setting controls the URL where the terminal is accessible. code PHP // config/terminal.php 'path' => 'live-terminal', // You can change this to anything you want, for example: // 'path' => 'super-secret-admin-console', After changing the path, remember to clear your route cache: php artisan route:clear. Troubleshooting 404 Not Found: Your route cache is likely out of date. Run php artisan route:clear. White Screen or JavaScript Errors: Your application cache is likely out of date, preventing the service provider from loading. Run php artisan optimize:clear. Commands return Apache/Nginx help menu: The package cannot find your PHP executable. Set the correct path in config/terminal.php under the php_path key.
tanbhirhossain/laravel-live-terminal 适用场景与选型建议
tanbhirhossain/laravel-live-terminal 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 08 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「terminal」 「laravel」 「artisan」 「web-terminal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tanbhirhossain/laravel-live-terminal 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tanbhirhossain/laravel-live-terminal 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tanbhirhossain/laravel-live-terminal 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Collection of handy Laravel artisan commands that most projects needs
A fork of runcmf/runtracy
Additional artisan commands for Laravel
PHP Terminal emulator controller utilizing ANSI escape sequence coding.
Enterprise-Grade Modular Architecture for Laravel Applications - A powerful Laravel package that revolutionizes application development with robust Service Repository Pattern, Dynamic Module Management, and 50+ Artisan commands for scalable, maintainable applications.
Render small SVG icons to monochrome ANSI for terminal UIs (Laravel/Prompts, Symfony Console, plain CLI).
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-24