PHPackages                             robin-ivi/google-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. robin-ivi/google-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

robin-ivi/google-auth
=====================

Laravel Google Login Package

1.0.2(2mo ago)46↓92.9%1MITPHPPHP &gt;=8.1

Since Apr 3Pushed 2mo agoCompare

[ Source](https://github.com/robin-ivi/google-auth)[ Packagist](https://packagist.org/packages/robin-ivi/google-auth)[ Docs](https://github.com/robin-ivi/google-auth)[ RSS](/packages/robin-ivi-google-auth/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

🚀 Laravel Google Auth Package
=============================

[](#-laravel-google-auth-package)

Simple &amp; plug-and-play Google Login package for Laravel using Socialite. Just install, add `.env` keys, and you're ready to go🔥

---

📦 Features
----------

[](#-features)

- ✅ Google Login (OAuth 2.0)
- ✅ Auto User Registration
- ✅ Session-based Authentication
- ✅ Minimal Setup (Only `.env`)
- ✅ Clean &amp; Lightweight Package

---

🛠️ Installation
---------------

[](#️-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require robin-ivi/google-auth
```

---

### Step 2: Install Socialite

[](#step-2-install-socialite)

```
composer require laravel/socialite
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### Step 3: Add Google Credentials in `.env`

[](#step-3-add-google-credentials-in-env)

```
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://127.0.0.1:8000/auth/google/callback
```

---

### Step 4: Update `config/services.php`

[](#step-4-update-configservicesphp)

```
'google' => [
    'client_id' => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'redirect' => env('GOOGLE_REDIRECT_URI'),
],
```

---

### Step 5: Clear Config Cache

[](#step-5-clear-config-cache)

```
php artisan config:clear
php artisan cache:clear
```

---

🔑 Google Console Setup
----------------------

[](#-google-console-setup)

Go to Google Cloud Console:

- Create OAuth Client ID
- Application Type: Web Application

### Add Authorized Redirect URI:

[](#add-authorized-redirect-uri)

```
http://127.0.0.1:8000/auth/google/callback

```

⚠️ Note:

- `.test` domains are NOT supported
- Use `localhost` or real domain only

---

🚀 Usage
-------

[](#-usage)

### Visit the login route:

[](#visit-the-login-route)

```
http://127.0.0.1:8000/auth/google

```

---

🔄 Available Routes
------------------

[](#-available-routes)

RouteDescription`/auth/google`Redirect to Google`/auth/google/callback`Handle callback---

👤 How It Works
--------------

[](#-how-it-works)

1. User clicks Google Login
2. Redirects to Google
3. User authenticates
4. Callback receives user data
5. User is created (if not exists)
6. User is logged in automatically

---

🧪 Testing
---------

[](#-testing)

Run the Laravel server:

```
php artisan serve
```

Then open:

```
http://127.0.0.1:8000/auth/google

```

---

❗ Common Issues &amp; Fixes
---------------------------

[](#-common-issues--fixes)

### 1. Session store not set

[](#1-session-store-not-set)

✔ Use `web` middleware

---

### 2. invalid\_client (401)

[](#2-invalid_client-401)

✔ Check Client ID / Secret ✔ Check Redirect URI exact match

---

### 3. Invalid redirect domain

[](#3-invalid-redirect-domain)

❌ `.test` not allowed ✔ Use `127.0.0.1` or real domain

---

📁 Package Structure
-------------------

[](#-package-structure)

```
src/
 ├── Controllers/
 │   └── GoogleController.php
 ├── routes/
 │   └── web.php
 ├── GoogleAuthServiceProvider.php

```

---

🔥 Future Updates
----------------

[](#-future-updates)

- 🔹 Multiple Providers (Facebook, GitHub)
- 🔹 API Support (JWT)
- 🔹 Role-based Redirect
- 🔹 Avatar Storage

---

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome! For major changes, open an issue first.

---

📄 License
---------

[](#-license)

MIT License

---

👨‍💻 Author
----------

[](#‍-author)

Krishna Mishra GitHub:

---

⭐ Support
---------

[](#-support)

If you like this package, give it a star ⭐ on GitHub!

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

89d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7964c842c6dc014ec3cfb2806d052a1cd36f103e35eb7bd8580238ee8967883e?d=identicon)[robinivi](/maintainers/robinivi)

---

Top Contributors

[![robin-ivi](https://avatars.githubusercontent.com/u/59382640?v=4)](https://github.com/robin-ivi "robin-ivi (6 commits)")

---

Tags

google-loginlaraveljavascriptgoogleroutingloginGoogle login

### Embed Badge

![Health badge](/badges/robin-ivi-google-auth/health.svg)

```
[![Health](https://phpackages.com/badges/robin-ivi-google-auth/health.svg)](https://phpackages.com/packages/robin-ivi-google-auth)
```

###  Alternatives

[mageplaza/magento-2-social-login

Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps

1841.2M5](/packages/mageplaza-magento-2-social-login)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

2191.1M10](/packages/dutchcodingcompany-filament-socialite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
