当前位置: 首页 > 软件库 > 开发工具 > PHP开发工具 >

laravel-web-tinker

Tinker in your browser
授权协议 MIT License
开发语言 PHP
所属分类 开发工具、 PHP开发工具
软件类型 开源软件
地区 不详
投 递 者 龙欣德
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Artisan Tinker in your browser

Latest Version on PackagistGitHub Workflow StatusTotal Downloads

Artisan's tinker command is a great way to tinker with your application in the terminal. Unfortunately running a few lines of code, making edits, and copy/pasting code can be bothersome. Wouldn't it be great to tinker in the browser?

This package will add a route to your application where you can tinker to your heart's content.

Web tinker light

In case light hurts your eyes, there's a dark mode too.

Web tinker dark

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

�� A word to the wise ��

This package can run arbitrary code. Unless you know what you are doing, you should never install or use this in a production environment, or any environment where you handle real world data.

Installation

You can install the package via composer:

composer require spatie/laravel-web-tinker --dev

Next, you must publish the assets from this package by running this command.

php artisan web-tinker:install

Optionally, you can publish the config file of the package.

php artisan vendor:publish --provider="Spatie\WebTinker\WebTinkerServiceProvider" --tag="config"

This is the content that will be published to 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 \Spatie\WebTinker\OutputModifiers\OutputModifier.
    */
    'output_modifier' => \Spatie\WebTinker\OutputModifiers\PrefixDateTime::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),
];

Usage

By default this package will only run in a local environment.

Visit /tinker in your local environment of your app to view the tinker page.

Authorization

Should you want to run this in another environment (we do not recommend this), there are two steps you must perform.

  1. You must register a viewWebTinker ability. A good place to do this is in the AuthServiceProvider that ships with Laravel.
public function boot()
{
    $this->registerPolicies();

    Gate::define('viewWebTinker', function ($user = null) {
        // return true if access to web tinker is allowed
    });
}
  1. You must set the enabled variable in the web-tinker config file to true.

Modifying the output

You can modify the output of tinker by specifying an output modifier in the output_modifier key of the web-tinker config file. An output modifier is any class that implements \Spatie\WebTinker\OutputModifiers\OutputModifier.

This is how that interface looks like.

namespace Spatie\WebTinker\OutputModifiers;

interface OutputModifier
{
    public function modify(string $output = ''): string;
}

The default install of this package will use the PrefixDataTime output modifier which prefixes the output from Tinker with the current date time.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Credits

This package was inspired by and uses code from the nova-tinker-tool package by Marcel Pociot.

License

The MIT License (MIT). Please see License File for more information.

  • 版本说明[Laravel 4.2](#laravel-4.2) [Laravel 4.1](#laravel-4.1) Laravel 4.2 通过在4.2版本的安装目录下运行命令“php artisan changes”来获得此版本完整的变更列表, 也可以查看Github上的变更文件(https://github.com/laravel/framework/blob/4.2/src/Illumi

  • 简介 JWT 全称 JSON Web Tokens ,是一个非常轻巧的规范。这个规范允许我们使用 JWT 在用户和服务器之间传递安全可靠的信息。它的两大使用场景是:认证和数据交换。 JWT 超详细分析 参考文献:https://learnku.com/articles/17883 Laravel 使用 JWT 完整使用详解 1. 使用 composer 安装 # 建议使用1.0以上版本 compo

  • 本地laravel环境从 laravel6 升级到 laravel7 后,没问题,可以访问,artisan命令可以执行 [root@localhost total_smp]# php artisan cache:clear Application cache cleared! [root@localhost total_smp]# composer dumpautoload Generating

  • The author selected The FreeBSD Foundation to receive a donation as part of the Write for DOnations program. 作者选择FreeBSD基金会作为Write for DOnations计划的一部分接受捐赠。 介绍 (Introduction) Over the past few years, D

  • laravel7 环境准备 phpstudy_pro ​ 新版本的比旧版好用多了。我直接用新版本,下载安装非常简单,网上教程一大把。安装完成后再安装composer,window版的一路next下来就可以了,然后配置环境变量 如D:\phpstudy_pro\Extensions\php\php7.3.4nts #更换国内阿里源 毕竟国外下载速度慢 composer config -g repo.

  • 在此示例中,我们将使用maatwebsite/excel composer程序包执行导入和导出任务。 maatwebsite/excel提供了使用数据库模型进行导入和导出的简便方法。 我们使用了maatwebsite/excel 版本3,它提供了从数据库导入导出数据的好方法,因此首先要执行几个步骤以获取示例。   第1步:安装Laravel 8 在这里,我们需要使用下面命令安装Laravel 8应

  • 场景 拼团功能,当 A 客户开团之后(两人团),如果 B 和 C 同时支付,如何规避两人同时将拼团人数增加。 Laravel 中 sharedLock 与 lockForUpdate 的区别 sharedLock 对应的是 LOCK IN SHARE MODE lockForUpdate 对应的是 FOR UPDATE sharedLock 与 lockForUpdate 相同的地方是,都能避免同

  • 认证原理       Laravel 的认证组件由 guards 和 providers 组成,guard 定义了用户在每个请求中如何实现认证,例如,Laravel 通过session guard 来维护 Session 存储的状态和 Cookie。provider 定义了如何从持久化存储中获取用户信息,laravel 底层支持通过 Eloquent 和数据库查询构建器两种方式来获取用户。    

  • 设备:MAC 进入web服务的项目目录下 我的web服务项目路径是用户路径下的 Workespaces/php cd Workespaces/php pwd /Users/nht/Workespaces/php 使用composer创建laravel项目 composer create-project laravel/laravel laravelapp --prefer-

 相关资料
  • 我试图将我的Laravel项目上传到我的网络服务器,但我过去的两次尝试都没有成功。我相信我没有上传文件到正确的位置。 我说我需要将我所有的laravel文件上传到public_html中,对吗? 这是我的Laravel项目的目录: 编辑:我现在已经将所有文件添加到根文件夹中,并将public添加到public_html中,但是我的路由似乎都不起作用。(它们在本地主机上工作得非常好)。所有东西都会抛

  • 我在laravel开发了一个网站,并上传到网络服务器。我将所有文件和文件夹上传到根目录和公共文件夹的文件public_html。现在,当我键入网址到我的浏览器的主页工作正常,但我的其他路线显示 在laravel文档中,我发现“存储和引导/缓存目录中的目录应该可以由web服务器写入,否则laravel将无法运行。” 这是原因吗。如果是,那么我该怎么做?

  • 问题内容: 我想使用网络套接字在Laravel中实现网络通知。我尝试过推杆。这很容易,但是它是付费的。我还尝试了redis和socket.io,必须为其安装Horizo​​n。我正在运行Windows,但根据我对地平线的了解,无法在Windows上安装它。 所以我对推送通知非常困惑。我正在尝试至少一个星期,但尚未找到任何解决方案。我的前端在angluar 5 / android中,后端在Larav

  • 我试图给我设置一个本地项目,这个项目在主机服务器上运行得非常好(总是数据)。 我在服务器的根(/项目)上做了一个项目文件夹,在那里我上传了我所有的文件,我复制了公共文件夹到 /www 本教程的具体解释如下:https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hostin

  • 我正在使用Laravel 5.4。 1)我添加网站。在这里输入图像描述 现在一切都好了。 2)尝试在facebook上打开网站,得到这个错误在这里输入图像描述 哎呀,好像出了什么事。 1/1方法不允许RouteCollection中出现HttpException。php第233行 Symfony\Component\HttpKernel\Excelie\在RouteCollection.php行2

  • CORS策略阻止从来源“http://localhost:8080/socket.io/?eio=3&transport=polling&t=mgbuvgw”访问位于“http://localhost:4200”的XMLHttpRequest:请求的资源上没有“Access-Control-Allow-Origin”标头。