├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Laravel-Shell-transparent.png ├── SECURITY.md ├── Screenshot_2023-02-05_192731.png └── Screenshot_2023-02-05_193258.png ├── .gitignore ├── LICENSE ├── README.md ├── composer.json └── src ├── Http ├── Controllers │ └── AssetController.php └── Livewire │ └── Terminal.php ├── LaravelShellServiceProvider.php ├── Rules └── CommandRule.php ├── config └── laravel-shell.php ├── resources ├── css │ └── xterm.css ├── js │ ├── xterm.js │ └── xterm.js.map └── views │ ├── layouts │ └── app.blade.php │ └── livewire │ └── terminal.blade.php └── routes ├── assets.php └── web.php /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | jakyeru@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Laravel-Shell 2 | 3 | A big welcome and thank you for considering contributing to Laravel-Shell! 4 | 5 | Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests. 6 | 7 | ## Quicklinks 8 | 9 | * [Code of Conduct](#code-of-conduct) 10 | * [Getting Started](#getting-started) 11 | * [Issues](#issues) 12 | * [Pull Requests](#pull-requests) 13 | * [Getting Help](#getting-help) 14 | 15 | ## Code of Conduct 16 | 17 | We take our open source community seriously and hold ourselves and other contributors to high standards of communication. By participating and contributing to this project, you agree to uphold our [Code of Conduct](https://github.com/JakyeRU/Laravel-Shell/blob/main/.github/CODE_OF_CONDUCT.md). 18 | 19 | ## Getting Started 20 | 21 | Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both: 22 | 23 | - To report security vulnerabilities, please read our [Security Policy](https://github.com/JakyeRU/Laravel-Shell/blob/main/.github/SECURITY.md). 24 | - Search for existing Issues and PRs before creating your own. 25 | - We work hard to makes sure issues are handled in a timely manner but, depending on the impact, it could take a while to investigate the root cause. A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking. 26 | 27 | ### Issues 28 | 29 | Issues should be used to report problems with the library, request a new feature, or to discuss potential changes before a PR is created. When you create a new Issue, a template will be loaded that will guide you through collecting and providing the information we need to investigate. 30 | 31 | If you find an Issue that addresses the problem you're having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help be indicating to our maintainers that a particular problem is affecting more than just the reporter. 32 | 33 | ### Pull Requests 34 | 35 | PRs to our libraries are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should: 36 | 37 | - Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both. 38 | - Add unit or integration tests for fixed or changed functionality (if a test suite already exists). 39 | - Address a single concern in the least number of changed lines as possible. 40 | - Include documentation in the repo. 41 | - Be accompanied by a complete Pull Request template (loaded automatically when a PR is created). 42 | 43 | For changes that address core functionality or would require breaking changes (e.g. a major release), it's best to open an Issue to discuss your proposal first. This is not required but can save time creating and reviewing changes. 44 | 45 | In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr) 46 | 47 | 1. Fork the repository to your own GitHub account 48 | 2. Clone the project to your machine 49 | 3. Create a branch locally with a succinct but descriptive name 50 | 4. Commit changes to the branch 51 | 5. Following any formatting and testing guidelines specific to this repo 52 | 6. Push changes to your fork 53 | 7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes. 54 | -------------------------------------------------------------------------------- /.github/Laravel-Shell-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakyeRU/laravel-shell/eaace64992ac5f67c4b5308654d4c7ef1f00d3e3/.github/Laravel-Shell-transparent.png -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | **PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY** 4 | 5 | ## Supported Versions 6 | 7 | Only the latest major version receives security fixes. 8 | 9 | ## Reporting a Vulnerability 10 | 11 | Report security vulnerabilities to **[jakye@jakye.me](mailto:jakye@jakye.me)** or **[jakyeru@gmail.com](mailto:jakyeru@gmail.com)**. 12 | -------------------------------------------------------------------------------- /.github/Screenshot_2023-02-05_192731.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakyeRU/laravel-shell/eaace64992ac5f67c4b5308654d4c7ef1f00d3e3/.github/Screenshot_2023-02-05_192731.png -------------------------------------------------------------------------------- /.github/Screenshot_2023-02-05_193258.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakyeRU/laravel-shell/eaace64992ac5f67c4b5308654d4c7ef1f00d3e3/.github/Screenshot_2023-02-05_193258.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | composer.lock 4 | /phpunit.xml 5 | .phpunit.result.cache 6 | /.idea 7 | /.vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Jakye 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 |

6 | 7 |

8 | release 9 |

10 | 11 | # About Laravel Shell 12 | > **Warning** Laravel-Shell is not a full-fledged terminal interface and its functionality is limited to running shell commands via the PHP exec function. As a result, it may not be suitable for running interactive shell processes. However, this package was designed specifically to aid administrators on shared servers that do not have SSH access, but it can be utilized by anyone. Keep this in mind when deciding if this package meets your needs. 13 | 14 | Laravel-Shell is a package for Laravel applications that adds a terminal interface to your web application. This allows you to run shell commands directly from your browser. With "Laravel-Shell", you can access the terminal from anywhere, at any time, and execute commands on the fly. 15 | 16 | The package integrates seamlessly into Laravel, and the terminal interface is intuitive and user-friendly. You can run a wide range of commands, including those related to database management, file management, and more. 17 | 18 | # Installation 19 | You can install the package via composer: 20 | 21 | ```bash 22 | composer require jakyeru/laravel-shell 23 | ``` 24 | After installing you can navigate to `/laravel-shell` to access the terminal. 25 | > **Warning** It is recommended that you secure your terminal with a middleware by publishing the configuration. 26 | ```bash 27 | php artisan vendor:publish --provider="Jakyeru\LaravelShell\LaravelShellServiceProvider" --tag="config" 28 | ``` 29 | 30 | # Version Compatibility 31 | > **Note** Laravel-Shell follows [Laravel's Support Policy](https://laravel.com/docs/master/releases). 32 | 33 | | Laravel Version | Laravel-Shell Version | PHP Version | Active Support | Security Fixes | 34 | |:---------------:|:---------------------:|:-----------:|:--------------:|:--------------:| 35 | | 11 | ^2 | 8.2-8.3 | ✅ | ✅ | 36 | | 10 | ^1.2.0 | 8.1-8.2 | ❌ | ✅ | 37 | | 9 | 1.0.0-1.1.1 | 8.0 | ❌ | ❌ | 38 | 39 | # Screenshots 40 |

41 |
42 | 43 |

44 | 45 | 46 | # Contributing 47 | Thank you for considering contributing to Laravel-Shell! You can read the contribution guide [here](https://github.com/JakyeRU/Laravel-Shell/blob/main/.github/CONTRIBUTING.md). 48 | 49 | # Code of Conduct 50 | In order to ensure that the community is welcoming to everyone, please review and abide by the [Code of Conduct](https://github.com/JakyeRU/Laravel-Shell/blob/main/.github/CODE_OF_CONDUCT.md). 51 | 52 | # Security Vulnerabilities 53 | If you need to report a security vulnerability please read our [Security Policy](https://github.com/JakyeRU/Laravel-Shell/blob/main/.github/SECURITY.md). 54 | 55 | # License 56 | Laravel-Shell is open-sourced software licensed under the [MIT](https://github.com/JakyeRU/Laravel-Shell/blob/main/LICENSE) license. 57 | 58 | If you encounter any other error(s), please open an issue on [GitHub](https://github.com/JakyeRU/Laravel-Shell/issues/new/choose). 59 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jakyeru/laravel-shell", 3 | "description": "Laravel-Shell adds a terminal interface to your web application, allowing you to run shell commands directly from your browser.", 4 | "type": "library", 5 | "require": { 6 | "php": "^8.2|^8.3", 7 | "laravel/framework": "^11", 8 | "livewire/livewire": "^3" 9 | }, 10 | "require-dev": { 11 | "phpunit/phpunit": "^11" 12 | }, 13 | "extra": { 14 | "laravel": { 15 | "providers": [ 16 | "Jakyeru\\LaravelShell\\LaravelShellServiceProvider" 17 | ] 18 | } 19 | }, 20 | "license": "MIT", 21 | "autoload": { 22 | "psr-4": { 23 | "Jakyeru\\LaravelShell\\": "src/" 24 | } 25 | }, 26 | "authors": [ 27 | { 28 | "name": "Jakye", 29 | "email": "jakye@jakye.me" 30 | } 31 | ], 32 | "minimum-stability": "dev" 33 | } 34 | -------------------------------------------------------------------------------- /src/Http/Controllers/AssetController.php: -------------------------------------------------------------------------------- 1 | file($path, [ 21 | 'Content-Type' => str_ends_with($asset, '.css') ? 'text/css' : 'application/javascript', 22 | ]); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Http/Livewire/Terminal.php: -------------------------------------------------------------------------------- 1 | 'laravel-shell::layouts.app']); 31 | config(['livewire.class_namespace' => 'Jakyeru\LaravelShell\Http\Livewire']); 32 | 33 | $this->changeDirectory(base_path(), false); 34 | } 35 | 36 | /** 37 | * Render the component. 38 | */ 39 | public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Contracts\Foundation\Application 40 | { 41 | return view('laravel-shell::livewire.terminal'); 42 | } 43 | 44 | /** 45 | * Run a command. 46 | */ 47 | public function runCommand(string $command): void 48 | { 49 | chdir($this->currentDirectory); 50 | 51 | if (Str::startsWith($command, 'cd')) { 52 | $this->changeDirectory(substr($command, 3)); 53 | return; 54 | } 55 | 56 | $validator = validator(['command' => $command], [ 57 | 'command' => ['required', new CommandRule], 58 | ]); 59 | 60 | if ($validator->fails()) { 61 | $this->dispatch('laravel-shell:terminal-output', ['output' => [$validator->errors()->first()]]); 62 | return; 63 | } 64 | 65 | $output = []; 66 | 67 | exec($this->commandLine . ' ' . $command . '" 2>&1', $output); 68 | 69 | foreach ($output as $key => $value) { 70 | $output[$key] = $value . PHP_EOL; 71 | $output[$key] = trim($value); 72 | } 73 | 74 | $this->dispatch('laravel-shell:terminal-output', ['output' => $output]); 75 | } 76 | 77 | /** 78 | * Change the current directory. 79 | */ 80 | public function changeDirectory(string $directory, bool $dispatch=true): void 81 | { 82 | if (is_dir($directory)) { 83 | chdir($directory); 84 | if (php_uname('s') === 'Windows NT') { 85 | $this->currentDirectory = str_replace('\\', '/', getcwd()); 86 | $this->commandLine = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command "cd ' . $this->currentDirectory . ';'; 87 | } else if (php_uname('s') === 'Linux' || php_uname('s') === 'Darwin') { 88 | $this->currentDirectory = getcwd(); 89 | $this->commandLine = 'bash -c "cd ' . $this->currentDirectory . ';'; 90 | } 91 | 92 | if ($dispatch) { 93 | $this->dispatch('laravel-shell:directory-change', ['directory' => $this->currentDirectory]); 94 | } 95 | } else { 96 | $this->dispatch('laravel-shell:terminal-output', ['output' => [__('Directory does not exist.')]]); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/LaravelShellServiceProvider.php: -------------------------------------------------------------------------------- 1 | mergeConfig(); 23 | } 24 | 25 | /** 26 | * Bootstrap the application services. 27 | */ 28 | public function boot(): void 29 | { 30 | $this->publishConfig(); 31 | 32 | if (config('laravel-shell.enabled')) { 33 | $this->registerRoutes(); 34 | $this->registerViews(); 35 | $this->registerLivewireComponents(); 36 | } 37 | } 38 | 39 | /** 40 | * Register the package config. 41 | */ 42 | protected function mergeConfig(): void 43 | { 44 | $this->mergeConfigFrom(__DIR__.'/config/laravel-shell.php', 'laravel-shell'); 45 | } 46 | 47 | /** 48 | * Publish the package config. 49 | */ 50 | protected function publishConfig(): void 51 | { 52 | $this->publishes([ 53 | __DIR__.'/config/laravel-shell.php' => config_path('laravel-shell.php'), 54 | ], 'config'); 55 | } 56 | 57 | /** 58 | * Register the package routes. 59 | */ 60 | protected function registerRoutes(): void 61 | { 62 | $this->loadRoutesFrom(__DIR__.'/routes/web.php'); 63 | } 64 | 65 | /** 66 | * Register the package views. 67 | */ 68 | protected function registerViews(): void 69 | { 70 | $this->loadViewsFrom(__DIR__.'/resources/views', 'laravel-shell'); 71 | } 72 | 73 | /** 74 | * Register the livewire components. 75 | */ 76 | protected function registerLivewireComponents(): void 77 | { 78 | Livewire::component('laravel-shell::terminal', \Jakyeru\LaravelShell\Http\Livewire\Terminal::class); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Rules/CommandRule.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | private array $interactiveCommands = [ 24 | 'php artisan tinker', 25 | 'php artisan serve', 26 | 'php artisan queue:work', 27 | 'php artisan queue:listen', 28 | 'php artisan schedule:work', 29 | ]; 30 | 31 | /** 32 | * Determine if the validation rule passes. 33 | */ 34 | public function passes(mixed $attribute, mixed $value): bool 35 | { 36 | if (empty($value)) { 37 | $this->error_message = __('The command cannot be empty.'); 38 | return false; 39 | } 40 | 41 | foreach ($this->interactiveCommands as $command) { 42 | if (str_contains($value, $command)) { 43 | $this->error_message = __('This command is not allowed to be run.'); 44 | return false; 45 | } 46 | } 47 | 48 | return true; 49 | } 50 | 51 | /** 52 | * Get the validation error message. 53 | */ 54 | public function message(): string 55 | { 56 | return $this->error_message; 57 | } 58 | } -------------------------------------------------------------------------------- /src/config/laravel-shell.php: -------------------------------------------------------------------------------- 1 | env('LARAVEL_SHELL_ENABLED', true), 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Route Configuration 19 | |-------------------------------------------------------------------------- 20 | | 21 | | Here you may configure the route that will be used to access Laravel 22 | | Shell. 23 | | 24 | */ 25 | 26 | 'route' => [ 27 | 'prefix' => 'laravel-shell', 28 | 'middleware' => ['web'], 29 | ], 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Terminal Customization 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure how the terminal will look. 37 | | 38 | */ 39 | 40 | 'terminal' => [ 41 | 'colors' => [ 42 | 'foreground' => '#eff0eb', 43 | 'background' => '#282a36', 44 | 'cursorAccent' => '#282a36', 45 | 'selection' => '#97979b33', 46 | 'black' => '#282a36', 47 | 'brightBlack' => '#686868', 48 | 'red' => '#890301', 49 | 'brightRed' => '#ff5c57', 50 | 'green' => '#5af78e', 51 | 'brightGreen' => '#5af78e', 52 | 'yellow' => '#f3f99d', 53 | 'brightYellow' => '#f3f99d', 54 | 'blue' => '#57c7ff', 55 | 'brightBlue' => '#57c7ff', 56 | 'magenta' => '#ff6ac1', 57 | 'brightMagenta' => '#ff6ac1', 58 | 'cyan' => '#9aedfe', 59 | 'brightCyan' => '#9aedfe', 60 | 'white' => '#f1f1f0', 61 | 'brightWhite' => '#eff0eb', 62 | ], 63 | 'startup' => [ 64 | 'Welcome to \x1b[34;1mLaravel Shell\x1b[0m \x1b[93;1mv' . \Jakyeru\LaravelShell\LaravelShellServiceProvider::VERSION . '\x1b[0m!', 65 | 'Running Laravel \x1b[93;1mv' . Illuminate\Foundation\Application::VERSION . '\x1b[0m (PHP \x1b[93;1mv' . PHP_VERSION . '\x1b[0m)\r\n', 66 | ], 67 | 'showInteractiveWarning' => true, 68 | 'cursorBlink' => true, 69 | 'prompt' => '$ ', 70 | ], 71 | 72 | ]; 73 | -------------------------------------------------------------------------------- /src/resources/css/xterm.css: -------------------------------------------------------------------------------- 1 | .xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:0}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm .xterm-cursor-pointer,.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:transparent}.xterm .xterm-accessibility-tree{user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} -------------------------------------------------------------------------------- /src/resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel Shell 8 | 9 | 10 | 11 | @livewireStyles 12 | 13 | 14 | {{ $slot }} 15 | 16 | @livewireScripts 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/resources/views/livewire/terminal.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 167 |
-------------------------------------------------------------------------------- /src/routes/assets.php: -------------------------------------------------------------------------------- 1 | name('laravel-shell.assets.serve'); 16 | }); -------------------------------------------------------------------------------- /src/routes/web.php: -------------------------------------------------------------------------------- 1 | name('laravel-shell.terminal'); 16 | }); 17 | 18 | require __DIR__.'/assets.php'; --------------------------------------------------------------------------------