laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.34k stars 130 forks source link

Make shell available so people can listen for events #103

Closed GrahamCampbell closed 4 years ago

GrahamCampbell commented 4 years ago

Closes #101. Depends on https://github.com/bobthecow/psysh/pull/630.

You can listen for events now by adding the following code to the boot method of your app service provider:

    public function boot()
    {
        $this->callAfterResolving(Shell::class, function (Shell $shell) {
            $shell->addLoopListener(...);
        }
    }
taylorotwell commented 4 years ago

Resubmit this when the upstream PR is merged. Thanks.