Artisan의 Tinker 명령은 터미널에서 애플리케이션을 수정하는 좋은 방법입니다. 불행하게도 몇 줄의 코드를 실행하고, 편집하고, 코드를 복사/붙여넣는 일은 번거로울 수 있습니다. 브라우저를 만지작거리는 것이 좋지 않을까요?
이 패키지는 여러분이 마음대로 조작할 수 있는 경로를 애플리케이션에 추가합니다.
빛이 눈에 해로울 경우를 대비해 다크 모드도 있습니다.
우리는 동급 최고의 오픈 소스 패키지를 만드는 데 많은 리소스를 투자합니다. 유료 제품 중 하나를 구매하여 우리를 지원할 수 있습니다.
귀하가 사용하고 있는 당사 패키지를 언급하면서 귀하의 고향에서 엽서를 보내주셔서 진심으로 감사드립니다. 연락처 페이지에서 주소를 확인하실 수 있습니다. 우리는 수신된 모든 엽서를 가상 엽서 월에 게시합니다.
이 패키지는 임의의 코드를 실행할 수 있습니다. 자신이 무엇을 하고 있는지 알지 못하는 한, 프로덕션 환경이나 실제 데이터를 처리하는 환경에서 이 프로그램을 설치하거나 사용해서는 안 됩니다.
작곡가를 통해 패키지를 설치할 수 있습니다.
composer require spatie/laravel-web-tinker --dev
다음으로, 이 명령을 실행하여 이 패키지의 자산을 게시해야 합니다.
php artisan web-tinker:install
선택적으로 패키지의 구성 파일을 게시할 수 있습니다.
php artisan vendor:publish --provider= " SpatieWebTinkerWebTinkerServiceProvider " --tag= " config "
이것은 config/web-tinker.php
에 게시될 내용입니다.
return [
/*
* The web tinker page will be available on this path.
*/
' path ' => ' /tinker ' ,
/*
* Possible values are 'auto', 'light' and 'dark'.
*/
' theme ' => ' auto ' ,
/*
* By default this package will only run in local development.
* Do not change this, unless you know what your are doing.
*/
' enabled ' => env ( ' APP_ENV ' ) === ' local ' ,
/*
* This class can modify the output returned by Tinker. You can replace this with
* any class that implements SpatieWebTinkerOutputModifiersOutputModifier.
*/
' output_modifier ' => Spatie WebTinker OutputModifiers PrefixDateTime::class,
/*
* These middleware will be assigned to every WebTinker route, giving you the chance
* to add your own middlewares to this list or change any of the existing middleware.
*/
' middleware ' => [
Illuminate Cookie Middleware EncryptCookies::class,
Illuminate Session Middleware StartSession::class,
Spatie WebTinker Http Middleware Authorize::class,
],
/*
* If you want to fine-tune PsySH configuration specify
* configuration file name, relative to the root of your
* application directory.
*/
' config_file ' => env ( ' PSYSH_CONFIG ' , null ),
];
기본적으로 이 패키지는 로컬 환경에서만 실행됩니다.
Tinker 페이지를 보려면 앱의 로컬 환경에서 /tinker
방문하세요.
이를 다른 환경에서 실행하려면(권장하지 않음) 수행해야 하는 두 단계가 있습니다.
viewWebTinker
기능을 등록해야 합니다. 이를 수행하기에 좋은 곳은 Laravel과 함께 제공되는 AuthServiceProvider
입니다. public function boot ()
{
$ this -> registerPolicies ();
Gate:: define ( ' viewWebTinker ' , function ( $ user = null ) {
// return true if access to web tinker is allowed
});
}
web-tinker
구성 파일의 enabled
변수를 true
로 설정해야 합니다. web-tinker
구성 파일의 output_modifier
키에 출력 수정자를 지정하여 Tinker의 출력을 수정할 수 있습니다. 출력 수정자는 SpatieWebTinkerOutputModifiersOutputModifier
구현하는 클래스입니다.
해당 인터페이스는 다음과 같습니다.
namespace Spatie WebTinker OutputModifiers ;
interface OutputModifier
{
public function modify ( string $ output = '' ): string ;
}
이 패키지의 기본 설치에서는 Tinker의 출력 앞에 현재 날짜 시간을 추가하는 PrefixDataTime
출력 수정자를 사용합니다.
composer test
최근 변경된 사항에 대한 자세한 내용은 변경 로그를 참조하세요.
자세한 내용은 CONTRIBUTING을 참조하세요.
보안 관련 버그를 발견한 경우 이슈 트래커를 사용하는 대신 [email protected]로 메일을 보내주세요.
이 패키지는 Marcel Pociot의 nova-tinker-tool 패키지에서 영감을 받아 코드를 사용합니다.
MIT 라이센스(MIT). 자세한 내용은 라이센스 파일을 참조하십시오.