From 1d7389598123ee0b87d4893bdf042d40f7e6ce90 Mon Sep 17 00:00:00 2001 From: Jaeger Date: Fri, 15 Dec 2017 11:05:32 +0800 Subject: [PATCH] single instance --- src/QueryList.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/QueryList.php b/src/QueryList.php index 994a053..192f161 100644 --- a/src/QueryList.php +++ b/src/QueryList.php @@ -40,7 +40,7 @@ class QueryList { protected $query; protected $kernel; - protected static $plugins = []; + protected static $instance = null; /** * QueryList constructor. @@ -74,14 +74,14 @@ class QueryList } /** - * Get the QueryList instance + * Get the QueryList single instance * * @return QueryList */ public static function getInstance() { - $instance = new self(); - return $instance; + self::$instance || self::$instance = new self(); + return self::$instance; } /**