{"id":18360405,"url":"https://github.com/phpmohamednabil/php-google-login-api","last_synced_at":"2025-09-04T05:42:12.726Z","repository":{"id":185991066,"uuid":"674441168","full_name":"PHPMohamedNabil/php-google-login-api","owner":"PHPMohamedNabil","description":"It is an mvc example project for login with google api web pplication","archived":false,"fork":false,"pushed_at":"2023-08-07T13:13:06.000Z","size":963,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T19:18:44.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPMohamedNabil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-04T00:56:08.000Z","updated_at":"2023-08-04T19:26:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"34022188-40ce-4b76-91f4-8afb961b7449","html_url":"https://github.com/PHPMohamedNabil/php-google-login-api","commit_stats":null,"previous_names":["phpmohamednabil/php-google-login","phpmohamednabil/php-google-login-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PHPMohamedNabil/php-google-login-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPMohamedNabil%2Fphp-google-login-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPMohamedNabil%2Fphp-google-login-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPMohamedNabil%2Fphp-google-login-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPMohamedNabil%2Fphp-google-login-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPMohamedNabil","download_url":"https://codeload.github.com/PHPMohamedNabil/php-google-login-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPMohamedNabil%2Fphp-google-login-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273557364,"owners_count":25126792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T22:28:15.686Z","updated_at":"2025-09-04T05:42:12.682Z","avatar_url":"https://github.com/PHPMohamedNabil.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-google-login\nIt is an mvc example project for login with google api web pplication.\n\n![google_login_api](https://github.com/PHPMohamedNabil/php-google-login-api/assets/29188634/401d8d11-710e-485c-a308-4666bf21c932)\n\nFeatures\n--------\n* mvc google login api.\n* ability to register your logedin user data into database.\n* using well orginzied code.\n\nInstallation\n------------\n\n1. download zip folder.\n2. install composer.\n3. goto .env to put your google client_id and secret_key.\n4. run command composer install to install pacakge.\n5. open command prompt and write php migrate (optional :if you are storing user data to database)\n6. open public folder and run command php -S localhost:8000 (to start php local server you can choose and localhost port you want)\n\n# install composer project packages:\n    composer install \n### run migration command for storing data to database mysql\n     php migrate  \n### go to public folder and start your localhost server\n     php -S localhost:8000   \n\n# put your google api setting \n\n```php\nAPP_NAME=GoogleLogin\nENVIROMENT=development\n\nDB=mysql\nHOSTNAME=localhost\nUSERNAME=root\nPASSWORD=\nDBNAME=google\n\nGoogle_Client_ID= your google client_id\nGoogle_Client_Secret= your google secret_key\n\nSESSION_LIFE_TIME=1800\nSESSION_IDLE_TIME=1000\n```\n# Routing\n go to app\\route\\web.php and edit your routing settings\n```php\nuse App\\Core\\Route\\Router as Route;\nuse App\\Controllers\\GoogleController;\n\nRoute::get('/google/login',[GoogleController::class,'index'])-\u003ename('google_login')-\u003emiddleware('checkLogin');\nRoute::get('/google/user',[GoogleController::class,'home'])-\u003ename('home_page')-\u003emiddleware('authCheck');\nRoute::get('/logout',[GoogleController::class,'logout'])-\u003ename('logout')-\u003emiddleware('authCheck');\n\nRoute::get('/','start');\n\n//Route::get('/google/user',[GoogleController::class,'profile'])-\u003ename('home_page')-\u003emiddleware('authCheck');\n// use this route if you are storing user data in database\n```\n\n# main site url\n go to app\\config\\config_constants.php and edit your configration your website url settings\n//webiste address and routes\n**edit SITE_URL constant to be your website url**\n```php\ndefine('SITE_URL','http://localhost:8000/');\ndefine('SITE_AD_URL','http://bookstore.local/admin/');\ndefine('VENDOR',ROOT_PATH.'vendor'.DS);\n```\n\n#Configration trait\n go to app\\traits\\GoogleConfigrationTrait.php and edit your configration your website url settings\n ### edit redirect url to be match one you wrote in google cloud api setting **!imporatant**\n ```php\nnamespace App\\Traits;\n\nuse Google_Service_Oauth2;\nuse App\\Core\\Database\\NativeDB;\n\ntrait GoogleConfigrationTrait{\n\n    protected Const REDIRECT_URL = SITE_URL.'google/login';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpmohamednabil%2Fphp-google-login-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpmohamednabil%2Fphp-google-login-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpmohamednabil%2Fphp-google-login-api/lists"}