signature=16530d25da0748d0326483d260f572ce,GitHub - recca0120/laravel-terminal at 547d48610952a7076d...

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667

Laravel Terminal

68747470733a2f2f7374796c6563692e696f2f7265706f732f34353839323532312f736869656c643f7374796c653d666c6174

68747470733a2f2f7472617669732d63692e6f72672f7265636361303132302f6c61726176656c2d7465726d696e616c2e737667

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f642f746f74616c2e737667

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f762f737461626c652e737667

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f762f756e737461626c652e737667

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f6c6963656e73652e737667

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f642f6d6f6e74686c79

68747470733a2f2f706f7365722e707567782e6f72672f7265636361303132302f7465726d696e616c2f642f6461696c79

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265636361303132302f6c61726176656c2d7465726d696e616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265636361303132302f6c61726176656c2d7465726d696e616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572

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

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

b2b42e5e6ac0322528b18d96ba242400.png

Artisan List

$ artisan

020bcc6dc4832a583298985e7823675b.png

Migrate

$ artisan migrate --seed

2a0cf6418c4f6787258488217cadc784.png

Artisan Tinker

$ artisan tinker

c12deaabb97bb86c6b1d851a96f5f7c5.png

MySQL

$ mysql

mysql> select * from users;

# change connection

mysql> use sqlite;

mysql> select * from users;

0b640c018ea78c66eb76dfe24f26ac28.png

Find Command

$ find ./ -name * -maxdepth 1

95cb7888cc26dac14717a45e326145de.png

Find and Delete

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

c7ef7a17cbb958d1ca38001bddd863e1.png

Vi

$ vi server.php

9f84a8b3621292b5e271a144ad24584e.png

54ac27a636cde28940256049152c3e8c.png

57b2a1e1f14f01112e3e68fbf2535f1b.png

Tail

$ tail

$ tail --line=1

$ tail server.php

$ tail server.php --line 5

97c44ff3042dd4f808b98eca0f556e0b.png

Cleanup

$ cleanup

9c907af6777576610ddbe2f8e88f8810.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值