spatie/laravel-web-tinker
Adds Laravel’s Tinker REPL to your browser via a protected route, making it easy to run and tweak code without the terminal. Includes light/dark UI and simple install/publish commands. For local/dev only—can execute arbitrary code.
Pros:
/tinker) with middleware support (e.g., EncryptCookies, StartSession), ensuring security boundaries.Cons:
--dev recommended).php artisan web-tinker:install).viewWebTinker gate) or other middleware (e.g., throttle).PSYSH_CONFIG support).local env (default) or enforce auth gates.Authorize class).OutputModifier).throttle middleware).PSYSH_CONFIG) may require testing./tinker in non-local environments? (e.g., IP whitelisting, OAuth, or custom gates).viewWebTinker gate).\Spatie\WebTinker\OutputModifiers\OutputModifier for custom formatting (e.g., JSON, colored output).web-tinker.php (e.g., throttle:60).PSYSH_CONFIG env var.composer.json for Laravel/PHP version compatibility.composer require spatie/laravel-web-tinker --dev
php artisan web-tinker:install
php artisan vendor:publish --provider="Spatie\WebTinker\WebTinkerServiceProvider" --tag="config"
APP_ENV=local or implement viewWebTinker gate for other environments.web-tinker.php (e.g., path, theme, middleware)./tinker route in local environment./tinker (e.g., via middleware).composer update spatie/laravel-web-tinker in CI/CD.web-tinker.php./tinker usage (e.g., common commands, output formatting).viewWebTinker gate or IP allowlists.viewWebTinker gate implementation.OutputModifier for custom needs./tinker route to debug issues.security@spatie.be./tinker.How can I help you explore Laravel packages today?