Package

Recca0120 Terminal

run laravel artisan command in web application

Package

recca0120/terminal

View on GitHub →

Laravel Terminal

Installation

composer require recca0120/terminal --dev

OR

Add Presenter to your composer.json file:

"require-dev": {
"recca0120/terminal": "^1.6.8"
}

Now, run a composer update on the command line from the root of your project:

composer update

Registering the Package

Include the service provider within app/config/app.php. The service povider is needed for the generator artisan command.

'providers' => [
...
Recca0120\Terminal\TerminalServiceProvider::class,
...
];

publish

artisan vendor:publish --provider="Recca0120\Terminal\TerminalServiceProvider"

URL

http://localhost/path/to/terminal

config

return [
'enabled' => env('APP_DEBUG'),
'whitelists' => ['127.0.0.1', 'your ip'],
'route' => [
'prefix' => 'terminal',
'as' => 'terminal.',
// if you use laravel 5.1, remember to remove web middleware
'middleware' => ['web'],
// if you need auth, you need use web and auth middleware
// 'middleware' => ['web', 'auth']
],
'commands' => [
\Recca0120\Terminal\Console\Commands\Artisan::class,
\Recca0120\Terminal\Console\Commands\ArtisanTinker::class,
\Recca0120\Terminal\Console\Commands\Cleanup::class,
\Recca0120\Terminal\Console\Commands\Find::class,
\Recca0120\Terminal\Console\Commands\Mysql::class,
\Recca0120\Terminal\Console\Commands\Tail::class,
\Recca0120\Terminal\Console\Commands\Vi::class,
// add your command
],
];

Available Commands

  • artisan
  • artisan tinker
  • find
  • mysql
  • tail
  • vi

Find

not full support, but you can delete file use this function (please check file permission)

find ./vendor -name tests -type d -maxdepth 4 -delete

Add Your Command

Add Command Class

// src/Console/Commands/Mysql.php
 
namespace Recca0120\Terminal\Console\Commands;
 
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
use Recca0120\Terminal\Contracts\TerminalCommand;
 
class Inspire extends Command implements TerminalCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'inspire';
 
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
 
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}
}

ScreenShot

Available Commands

$ help

Artisan List

$ artisan

Migrate

$ artisan migrate --seed

Artisan Tinker

$ artisan tinker

MySQL

$ mysql
mysql> select * from users;
 
# change connection
mysql> use sqlite;
mysql> select * from users;

Find Command

$ find ./ -name * -maxdepth 1

Find and Delete

$ find ./storage/logs -name * -maxdepth 1 -delete

Vi

$ vi server.php

Tail

$ tail
$ tail --line=1
$ tail server.php
$ tail server.php --line 5

Cleanup

$ cleanup

Recca0120 Terminal Related Articles

Laravel Terminal UI for the artisan dev Command image

Laravel Terminal UI for the artisan dev Command

Read article
Manage Laravel Cloud from the Terminal with the New Cloud CLI image

Manage Laravel Cloud from the Terminal with the New Cloud CLI

Read article
Build Terminal UIs in PHP With ANSI Kit image

Build Terminal UIs in PHP With ANSI Kit

Read article
Screen is a terminal renderer written in pure PHP image

Screen is a terminal renderer written in pure PHP

Read article
Phiki: A Powerful PHP-Based Syntax Highlighter for Web and Terminal image

Phiki: A Powerful PHP-Based Syntax Highlighter for Web and Terminal

Read article
Ghostty Is a Fast, Feature-Rich, Cross-Platform Terminal image

Ghostty Is a Fast, Feature-Rich, Cross-Platform Terminal

Read article
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Pushsilver logo

Pushsilver

Pushsilver is simple invoicing for freelancers and small studios — send polished invoices, automate reminders, and get paid on time without the bloat.

Pushsilver
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum