PHPackages                             gere-lajos/laravel-web-tinker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gere-lajos/laravel-web-tinker

Abandoned → [luminarix/laravel-web-tinker](/?search=luminarix%2Flaravel-web-tinker)Library[Utility &amp; Helpers](/categories/utility)

gere-lajos/laravel-web-tinker
=============================

Small Laravel package to use Tinker in your browser

v0.3.1(1y ago)221[4 PRs](https://github.com/gere-lajos/laravel-web-tinker/pulls)MITTypeScriptPHP ^8.2CI passing

Since May 9Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/gere-lajos/laravel-web-tinker)[ Packagist](https://packagist.org/packages/gere-lajos/laravel-web-tinker)[ Docs](https://github.com/gere-lajos/laravel-web-tinker)[ GitHub Sponsors]()[ RSS](/packages/gere-lajos-laravel-web-tinker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (14)Versions (13)Used By (0)

NOTE
====

[](#note)

We have transitioned the ongoing development of this project to a new repository. You can access it at [luminarix/laravel-web-tinker](https://github.com/luminarix/laravel-web-tinker). Please note that this current repository will no longer receive updates.

Small Laravel package to use Tinker in your browser
===================================================

[](#small-laravel-package-to-use-tinker-in-your-browser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/59533bc69f641712fba149624c9f254274b3d6e4515763b148e2a66f6c19fdfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676572652d6c616a6f732f6c61726176656c2d7765622d74696e6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gere-lajos/laravel-web-tinker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7ed259c06fe9c133b84aa8f1f91b3ee96fe51df8bba1a80e15f397f99c6a1ce8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676572652d6c616a6f732f6c61726176656c2d7765622d74696e6b65722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/gere-lajos/laravel-web-tinker/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/1d6faa84d86b285a1a8549b77694c7897ec1d54563e36e832db6f7d6607d7ab2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676572652d6c616a6f732f6c61726176656c2d7765622d74696e6b65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/gere-lajos/laravel-web-tinker/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/cf2af21caafd3f94a37f2e9eb03fcab0786f5137027c35bf0da8c4163ab90425/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676572652d6c616a6f732f6c61726176656c2d7765622d74696e6b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gere-lajos/laravel-web-tinker)

This package allows you to use Tinker in your browser. Wildly inspired by Spatie's [Laravel Web Tinker](https://github.com/spatie/laravel-web-tinker), but with added functionality, and React frontend.

🚨 A word to the wise 🚨
----------------------

[](#-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.

Known issues
------------

[](#known-issues)

- If you run the code with ctrl+enter or cmd+enter, the editor will also start a new line.
- History is shared between tabs, and is not cleared when you close the tab.
- Big outputs are not handled well, it can push the grid instead of breaking words.
- We must validate the stored code structure so it won't break the editor.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require gere-lajos/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="GereLajos\LaravelWebTinker\WebTinkerServiceProvider" --tag="config"
```

This is the content that will be published to `config/web-tinker.php`

If you previously installed Spatie's Web Tinker, you may have conflicts in the config file. You can safely remove the `web-tinker.php` file from the `config` directory.

```
return [

    /*
     * The web tinker page will be available on this path.
     */
    'path' => '/tinker',

    /*
     * 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' => \GereLajos\LaravelWebTinker\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,
        GereLajos\LaravelWebTinker\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),
];
```

Usage
-----

[](#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
-------------

[](#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
    });
}
```

2. You must set the `enabled` variable in the `web-tinker` config file to `true`.

Modifying the output
--------------------

[](#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 `\GereLajos\LaravelWebTinker\OutputModifiers\OutputModifier`.

This is how that interface looks like.

```
namespace GereLajos\LaravelWebTinker\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
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Gere Lajos](https://github.com/gere-lajos)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance65

Regular maintenance activity

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

728d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d509fc70f32b3dfa8874e6e71a2aecbfa0a75796ad6c142516ff7d947dc129f4?d=identicon)[gere-lajos](/maintainers/gere-lajos)

---

Top Contributors

[![gere-lajos](https://avatars.githubusercontent.com/u/21358947?v=4)](https://github.com/gere-lajos "gere-lajos (39 commits)")[![xHeaven](https://avatars.githubusercontent.com/u/14284867?v=4)](https://github.com/xHeaven "xHeaven (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravellaravel-web-tinkerGere Lajos

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/gere-lajos-laravel-web-tinker/health.svg)

```
[![Health](https://phpackages.com/badges/gere-lajos-laravel-web-tinker/health.svg)](https://phpackages.com/packages/gere-lajos-laravel-web-tinker)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
