Exemplo n.º 1
0
 public static function instance()
 {
     if (!Useragent::$singleton) {
         if (!self::$config) {
             self::$config = Config::get('useragent::config');
         }
         self::$agent = Request::server('HTTP_USER_AGENT');
         if (!is_null(self::$agent)) {
             if (self::_load_agent_data()) {
                 self::_compile_data();
             }
         }
         Useragent::$singleton = new Useragent();
     }
     return Useragent::$singleton;
 }
Exemplo n.º 2
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['useragent'] = $this->app->share(function ($app) {
         return Useragent::instance();
     });
 }