• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 4 login with google. $client = new Google_Client();

#1
i have install google api using compose 

composer require google/apiclient:"^2.0"

then its install google api lib in 

vendor/google

to user the lib just load like this

$client = new \Google_Client();

$client->setClientId(''); //Define your ClientID

$client->setClientSecret(''); //Define your Client Secret Key
$client->setRedirectUri(''); //Define your Redirect Uri
$client->addScope('email');
$client->addScope('profile');

ok i find how tu use after install with compose Big Grin
 $client = new Google_Client();
 $client = new Google_Client();
 $client = new Google_Client();[i] $cl[i] $client = new Google_Client();ient = new Google_Client();[/i][/i]
Reply

#2
(05-10-2020, 03:29 AM)asklinux Wrote: i have install google api using compose 

composer require google/apiclient:"^2.0"

then its install google api lib in 

vendor/google

to user the lib just load like this

$client = new \Google_Client();

$client->setClientId(''); //Define your ClientID

$client->setClientSecret(''); //Define your Client Secret Key
$client->setRedirectUri(''); //Define your Redirect Uri
$client->addScope('email');
$client->addScope('profile');

ok i find how tu use after install with compose Big Grin
 $client = new Google_Client();
 $client = new Google_Client();
 $client = new Google_Client();[i] $cl[i] $client = new Google_Client();ient = new Google_Client();[/i][/i]
PHP Code:
<?php

namespace App\Controllers;

use 
App\Controllers\BaseController;
use 
Google\Client as Google_Client;
use 
Google_Service_Oauth2
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.