• Reading time ~ 1 min
  • 28.01.2025

Laravel's Tinker package is a powerful REPL (Read-Eval-Print Loop) tool that allows you to interact with your Laravel application from the command line. It's a great tool to test your application's code without having to go through the hassle of creating a new controller or a route.

Once installed, you can essentially run the Laravel-specific code just by invoking the php artisan tinker command in your terminal. However, writing code in the terminal can sometimes be cumbersome, especially when dealing with multiple-line code.

But what if I tell you you can use Laravel Tinker even in Chrome DevTools?

Yes, you heard it right! We now have a Chrome extension by Tony Lea which, once installed, will add a new tab in Chrome DevTools called "PHP".

The trick that this extension pulls off is it utilizes Spatie's Laravel Web Tinker package, and iframes the route /tinker (created by the package for the project) in the DevTools panel, making it accessible throughout the development process without switching tabs.

Here's what that looks like.

Laravel Tinker in Chrome DevTools

The only prerequisite to using this extension is that you need to have the Laravel Web Tinker package installed in your Laravel application beforehand. You can install the package as a dev dependency using the following command.

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

Then publish the assets and you're good to go.

Currently, you can install the extension manually, the instructions of which can be found on its GitHub repository.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297

We shoot down "Shahed" drones every day. Each one downed means lives saved. But we need mobility: a van or a trailer. Every donation = another night under protection.

🚐 Van fundraiser for my unit, 1020 regiment 🎯 Goal: 500,000 ₴
🔗 Donation link 💳 4441 1111 2546 4663