Tinkerwell 4 is out now! See what's new or buy now.
Tinkerwell background image
Tinkerwell Logo Tinkerwell
Go back to Blog

Tinkerwell Shorts: Updating license information on our live platform

Using Tinkerwell to working on Tinkerwell is a common use case at Beyond Code. This time, a customer with multiple licenses requested if we can make it work that all their license keys expire at the same time so that it becomes easier for them to renew all their keys at once.

All their licenses are still active but vary with their renewal date – so we decided to update all their keys. For this, we wanted to sum up all days of all their Tinkerwell licenses where they qualify for updates.

After that, we divide that by the number of licenses so that we get the number of days from now that we need to add to each key.

Before we run the command, we checked if the date is correct and used Magic Comments for this information. Magic Comments display the value of a variable during the execution of the line of code. If a line get's executed multiple times, every output is appended at the end of the line as well.

Everything looked correct, so we run the update.

With this code written in a couple of minutes, we were able to make our customer happy and it was much easier than doing all the calculations by hand and changing the values in the database. We also stored this as a Code Snippet in Tinkerwell so that we can use the code if an additional custom has the same request again.

Jess Archer, Laravel Core team member
“Tinkerwell is the fastest way to test an idea or debug an application. It just keeps getting better and better!”

Jess Archer

Laravel Core team member

Mark Snape, Director
“Using Tinkerwell I feel more able to explore ideas and different ways of structuring my code before moving it into my project.”
Mark Snape

Director

Tinkerwell: The PHP Scratchpad

The must-have companion to your favorite IDE. Quickly iterate on PHP code within the context of your web application.

Buy now Learn more