/** * Return an instance of Db Class * If not connection to the database is made then firstly will try to connect to the database * If connection to the database fails then `false` value will be returned * * @return Mixed; */ public function db() { if (!self::$db) { self::$db = new Db($this->config('db')); self::$db->connect(); } return self::$db; }