This PR enables third party packages like Telescope to register after callbacks that get fired after each execution
of a command in the Tinker shell. This will enable packages like Telescope to simulate an application shutdown. Right now Telescope is unable to record events that happen in the Tinker shell because of the inability to simulate such a shutdown.
We can register Tinker after-callbacks now by adding the following code to the boot method of the app or package Service Provider:
public function boot()
{
$this->callAfterResolving(Shell::class, function (Shell $shell) {
$shell->addLoopListener(...);
});
}
Resubmission of https://github.com/laravel/tinker/pull/101 and https://github.com/laravel/tinker/pull/103
This PR enables third party packages like Telescope to register after callbacks that get fired after each execution of a command in the Tinker shell. This will enable packages like Telescope to simulate an application shutdown. Right now Telescope is unable to record events that happen in the Tinker shell because of the inability to simulate such a shutdown.
We can register Tinker after-callbacks now by adding the following code to the boot method of the app or package Service Provider: