What event is fired when Laravel app is being shutdown?

前端 未结 2 1473
失恋的感觉
失恋的感觉 2021-01-21 20:15

Specifically what I am doing is in my AppServiceProvider->boot() method I am creating a singleton class like below:

class AppServiceProvider extends ServiceProvi         


        
2条回答
  •  日久生厌
    2021-01-21 21:11

    IMHO you can try to add a terminating callback to your app instance, for example in the AppServiceProvider, i.e.:

    public function boot()
    {
        $this->app->terminating(function () {
           // your terminating code here
        });
    }
    

提交回复
热议问题