laravel terminal
v1.12.2
composer require recca0120/terminal --dev또는
Composer.json 파일에 발표자 추가 :
"require-dev" : {
"recca0120/terminal" : "^1.6.8"
}이제 프로젝트의 루트에서 명령 줄에서 작곡가 업데이트를 실행하십시오.
composer update
app/config/app.php 에 서비스 제공 업체를 포함시킵니다. Service Povider는 Generator Artisan Command에 필요합니다.
' providers ' => [
...
Recca0120 Terminal TerminalServiceProvider::class,
...
];게시
artisan vendor:publish --provider=" Recca0120 Terminal TerminalServiceProvider "http : // localhost/path/to/terminal
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
],
];전체 지원은 아니지만 파일 삭제이 함수를 삭제할 수 있습니다 (파일 권한을 확인하십시오).
find ./vendor -name tests -type d -maxdepth 4 -delete // 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 );
}
}$ help$ artisan$ artisan migrate --seed$ artisan tinker$ mysql
mysql > select * from users ;
# change connection
mysql > use sqlite ;
mysql > select * from users ;$ find ./ -name * -maxdepth 1$ find ./storage/logs -name * -maxdepth 1 -delete$ vi server.php$ tail
$ tail --line=1
$ tail server.php
$ tail server.php --line 5$ cleanup