Skip to content

Commit 1d73895

Browse files
committed
single instance
1 parent 03e6a95 commit 1d73895

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/QueryList.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueryList
4040
{
4141
protected $query;
4242
protected $kernel;
43-
protected static $plugins = [];
43+
protected static $instance = null;
4444

4545
/**
4646
* QueryList constructor.
@@ -74,14 +74,14 @@ public function __destruct()
7474
}
7575

7676
/**
77-
* Get the QueryList instance
77+
* Get the QueryList single instance
7878
*
7979
* @return QueryList
8080
*/
8181
public static function getInstance()
8282
{
83-
$instance = new self();
84-
return $instance;
83+
self::$instance || self::$instance = new self();
84+
return self::$instance;
8585
}
8686

8787
/**

0 commit comments

Comments
 (0)