Terminal

recca0120/terminal image

Terminal stats

Downloads
353.5K
Stars
829
Open Issues
14
Forks
55

View on GitHub →

run laravel artisan command in web application

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

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Recca0120 Terminal Related Articles

Uvora: A macOS Menu Bar App for Finding Laravel Projects image

Uvora: A macOS Menu Bar App for Finding Laravel Projects

Read article
What's missing from your PHP development environment image

What's missing from your PHP development environment

Read article
Showcase Your PhpStorm Expertise on LinkedIn image

Showcase Your PhpStorm Expertise on LinkedIn

Read article
Scheduler List: A Web Dashboard for Laravel's Scheduled Tasks image

Scheduler List: A Web Dashboard for Laravel's Scheduled Tasks

Read article
Laravel Installer Now Returns JSON When Running Inside an AI Agent image

Laravel Installer Now Returns JSON When Running Inside an AI Agent

Read article
Laravel Brain: Visualize Your Application's Request Lifecycle image

Laravel Brain: Visualize Your Application's Request Lifecycle

Read article
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
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
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel