{"id":13462015,"url":"https://github.com/spatie/laravel-web-tinker","last_synced_at":"2025-05-13T18:07:44.285Z","repository":{"id":43642696,"uuid":"160545642","full_name":"spatie/laravel-web-tinker","owner":"spatie","description":"Tinker in your browser","archived":false,"fork":false,"pushed_at":"2025-02-17T10:39:44.000Z","size":2634,"stargazers_count":1181,"open_issues_count":2,"forks_count":72,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-08T00:16:24.843Z","etag":null,"topics":["debug","laravel","php","tinker","tool"],"latest_commit_sha":null,"homepage":"https://spatie.be/open-source","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://spatie.be/open-source/support-us"}},"created_at":"2018-12-05T16:18:00.000Z","updated_at":"2025-05-01T20:14:51.000Z","dependencies_parsed_at":"2024-06-12T00:00:47.389Z","dependency_job_id":"714b9d7f-0044-45a5-8457-13143b7a1c19","html_url":"https://github.com/spatie/laravel-web-tinker","commit_stats":{"total_commits":190,"total_committers":34,"mean_commits":5.588235294117647,"dds":0.5263157894736843,"last_synced_commit":"d11282db6d173b035d8d4b55cf1c7601ce141dda"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-web-tinker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-web-tinker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-web-tinker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-web-tinker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/laravel-web-tinker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000849,"owners_count":21997441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","laravel","php","tinker","tool"],"created_at":"2024-07-31T12:00:37.355Z","updated_at":"2025-05-13T18:07:44.265Z","avatar_url":"https://github.com/spatie.png","language":"JavaScript","funding_links":["https://spatie.be/open-source/support-us"],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"readme":"# Artisan Tinker in your browser\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-web-tinker.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-web-tinker)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-web-tinker/run-tests?label=tests)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-web-tinker.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-web-tinker)\n\nArtisan'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?\n\nThis package will add a route to your application where you can tinker to your heart's content.\n\n![Web tinker light](https://spatie.github.io/laravel-web-tinker/light.png)\n\nIn case light hurts your eyes, there's a dark mode too.\n\n![Web tinker dark](https://spatie.github.io/laravel-web-tinker/dark.png)\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/laravel-web-tinker.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/laravel-web-tinker)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe 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](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## 🚨 A word to the wise 🚨\n\nThis 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.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require spatie/laravel-web-tinker --dev\n```\n\nNext, you must publish the assets from this package by running this command.\n\n```bash\nphp artisan web-tinker:install\n```\n\nOptionally, you can publish the config file of the package.\n\n```bash\nphp artisan vendor:publish --provider=\"Spatie\\WebTinker\\WebTinkerServiceProvider\" --tag=\"config\"\n```\n\nThis is the content that will be published to `config/web-tinker.php`\n\n```php\nreturn [\n\n    /*\n     * The web tinker page will be available on this path.\n     */\n    'path' =\u003e '/tinker',\n\n    /*\n     * Possible values are 'auto', 'light' and 'dark'.\n     */\n    'theme' =\u003e 'auto',\n\n    /*\n     * By default this package will only run in local development.\n     * Do not change this, unless you know what your are doing.\n     */\n    'enabled' =\u003e env('APP_ENV') === 'local',\n\n   /*\n    * This class can modify the output returned by Tinker. You can replace this with\n    * any class that implements \\Spatie\\WebTinker\\OutputModifiers\\OutputModifier.\n    */\n    'output_modifier' =\u003e \\Spatie\\WebTinker\\OutputModifiers\\PrefixDateTime::class,\n\n    /*\n    * These middleware will be assigned to every WebTinker route, giving you the chance\n    * to add your own middlewares to this list or change any of the existing middleware.\n    */\n    'middleware' =\u003e [\n        Illuminate\\Cookie\\Middleware\\EncryptCookies::class,\n        Illuminate\\Session\\Middleware\\StartSession::class,\n        Spatie\\WebTinker\\Http\\Middleware\\Authorize::class,\n    ],\n\n    /*\n     * If you want to fine-tune PsySH configuration specify\n     * configuration file name, relative to the root of your\n     * application directory.\n     */\n    'config_file' =\u003e env('PSYSH_CONFIG', null),\n];\n```\n\n## Usage\n\nBy default this package will only run in a local environment.\n\nVisit `/tinker` in your local environment of your app to view the tinker page.\n\n## Authorization\n\nShould you want to run this in another environment (we do not recommend this), there are two steps you must perform.\n\n1. You must register a `viewWebTinker` ability. A good place to do this is in the `AuthServiceProvider` that ships with Laravel.\n\n```php\npublic function boot()\n{\n    $this-\u003eregisterPolicies();\n\n    Gate::define('viewWebTinker', function ($user = null) {\n        // return true if access to web tinker is allowed\n    });\n}\n```\n\n2. You must set the `enabled` variable in the `web-tinker` config file to `true`.\n\n## Modifying the output\n\nYou 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`.\n\nThis is how that interface looks like.\n\n```php\nnamespace Spatie\\WebTinker\\OutputModifiers;\n\ninterface OutputModifier\n{\n    public function modify(string $output = ''): string;\n}\n```\n\nThe default install of this package will use the `PrefixDataTime` output modifier which prefixes the output from Tinker with the current date time.\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Credits\n\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\nThis package was inspired by and uses code from the [nova-tinker-tool](https://github.com/beyondcode/nova-tinker-tool) package by [Marcel Pociot](https://github.com/mpociot).\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-web-tinker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Flaravel-web-tinker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-web-tinker/lists"}