public function setCredentials($credentials)
    {
        if (function_exists('env')) {
            $host = env('DB_HOST');
            $dbname = env('DB_DATABASE');
            $username = env('DB_USERNAME');
            $password = env('DB_PASSWORD');
        } else {
            $host = $credentials['host'];
            $dbname = $credentials['dbname'];
            $username = $credentials['username'];
            $password = $credentials['password'];
        }

        $this->db = new PDO(
            "mysql:host={$host};dbname={$dbname};charset=utf8mb4",
            $username,
            $password
        );
    }