Code Monkey home page Code Monkey logo

nova-tinker-tool's Introduction

Nova Tinker Tool

Latest Version on Packagist Total Downloads

Use the power of Tinker within your Nova application.

tinker screenshot

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require beyondcode/nova-tinker-tool

Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

// ...
public function tools()
{
    return [
        // ...
        new \Beyondcode\TinkerTool\Tinker(),
    ];
}

Usage

Click on the new "Tinker" menu item in your Nova application. You can enter any PHP code and press CMD+Enter / CTRL+Enter to evaluate the expression. The return value will be displayed below.

The previous code and output will be stored in the localstorage in case you want to execute the same code snippets multiple times.

Settings

By default this Pysh will attempt to write to ~/.pysh which for most will result in an error when trying to use tinker. To avoid this issue adding an environment variable to change where Pysh will write to will resolve this:

XDG_CONFIG_HOME=/path/to/new/location

Security: Remote Code Execution

This should only be used for development and testing. Running tinker allows arbitrary code to be executed.

Any executed php code will have the same access as the running php instance. This means that the running application may be altered, and if run with root privileges, one can get complete control of the machine.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

nova-tinker-tool's People

Contributors

95jonpet avatar ijpatricio avatar lucacri avatar mpociot avatar ragingdave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nova-tinker-tool's Issues

Feature Request: Button/Shortcuts to clear Output and/or Tinker boxes

First off, Thanks for the awesome tool!

When testing this out I ran multiple commands with the same output (=> true). I was unable to confirm if my latest command was in fact run, since there was no change in the UI.

Adding buttons to clear the fields or some sort of separator line in the Output between commands would be nice.

I may submit a PR in the future once I get more acclimated with Nova.

Alternative tinker command execution

Hi, @mpociot

Thanks for your great package, first of all!
I'm a user of hyn/multitenant to create a multi-tenant environment through multiple databases, and for running tinker we have a variant command do to so:

php artisan tenancy:tinker --website_id=

How can I change tinker command associated to nova-tinker-tool?

Security: Remote code execution vulnerability

Running tinker allows arbitrary code to be executed. This is very dangerous.

Any executed php code will have the same access as the running php instance. This means that the running application may be altered, and if run with root privileges, one can get complete control of the machine.

This can be solved by:

  1. Notifying users of this in a readme file.
  2. Only allowing tinker to be run locally - env is set to local

Use Theme's icon color

Use the following Fill color instead of hardcoding the icon color
fill="var(--sidebar-icon)"

This is how it currently looks

screen shot 2018-09-19 at 8 10 15 pm

Not working on Vapor

Not sure if it's just impossible on Vapor, but I get a 500 error with the message "Writing to /home/sbx_user1051/.config/psysh is not allowed." when I try to run commands on Vapor.

Have a button to run and clear the php code.

For some reason Cmd-Enter is not being captured for me, so I am unable to run any code. Although I think keyboard shortcuts are great, it would be nice to simply have "Run" and "Clear" buttons.

I'm not sure if it is because of some plugins I have, or settings in Chrome but as is, unfortunately nova-tinker-tool is useless for me.

Thanks for considering this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.