app->singleton('agent', function ($app) { return new Agent($app['request']->server()); }); $this->app->alias('agent', Agent::class); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['agent', Agent::class]; } }