PHPackages                             statikbe/laravel-google-authenticate - 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. statikbe/laravel-google-authenticate

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

statikbe/laravel-google-authenticate
====================================

Google Authentication in Laravel

4.6.1(1w ago)712.9k↓33.3%1MITPHP

Since Dec 9Pushed 1w ago7 watchersCompare

[ Source](https://github.com/statikbe/laravel-google-authenticate)[ Packagist](https://packagist.org/packages/statikbe/laravel-google-authenticate)[ Docs](https://github.com/statikbe/laravel-google-authenticate)[ RSS](/packages/statikbe-laravel-google-authenticate/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (9)Versions (42)Used By (0)

[![Laravel Google Authenticate](assets/card.png)](assets/card.png)

Google Authenticator
====================

[](#google-authenticator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5badb376762a4a314e916343df3fef5b09f69845928a4e35931b155a4e62218d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174696b62652f6c61726176656c2d676f6f676c652d61757468656e7469636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statikbe/laravel-google-authenticate)[![Total Downloads](https://camo.githubusercontent.com/ef083684dd14630d63cb86906244d3edc33dc9791c24720ecb6d889aacfb701f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174696b62652f6c61726176656c2d676f6f676c652d61757468656e7469636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statikbe/laravel-google-authenticate)

This module gives you the option to let you (and your users) log in with their Google account on your Laravel application.

This is initially used to let only people log in from certain workspaces. But can be enabled to let everyone log in.

[Changelog](changelog.md) - [Upgrade guides](upgrade-guide.md)

---

Installation
------------

[](#installation)

Using Composer

```
composer require statikbe/laravel-google-authenticate
```

Usage
-----

[](#usage)

The package will automatically register itself.

You can publish the migration with the following command:

```
php artisan vendor:publish --provider="Statikbe\GoogleAuthenticate\GoogleAuthenticateServiceProvider" --tag="google-migrations"
```

To add the needed columns to your database run:

```
php artisan migrate
```

Add the `use HasGoogleAuth` trait in your `User.php` class. This will provide the necessary fillable options to your User.

In your .env file you should include the following keys:

```
GOOGLE_CLIENT_ID="YOUR_GOOGLE_CLIENT_ID"
GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_CLIENT_SECRET"
CALLBACK_URL_GOOGLE="https://www.domain.com/login/google/callback"
```

The next step is to add the following lines in your `services.php` config file

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

Info on how to create a Google Auth Client id and secret can be found [on their documentation page](https://developers.google.com/identity/protocols/OAuth2).

Finally, you can add google login route to your login and register views: `{{ route('google.auth.login') }}`.

### Config

[](#config)

Publish the config file

```
php artisan vendor:publish --provider="Statikbe\\GoogleAuthenticate\\GoogleAuthenticateServiceProvider" --tag="google-config"
```

#### Email domains

[](#email-domains)

You can change the email domains that can login using Google. The three available options are:

- `allowed`-array: only the domains in this array can login using Google
- `disabled`-array: domains in this array can not login using Google
- Empty / null: all domains can use the Google login

```
    'domains' => [
        //'allowed' => ['statik.be'],
        //'disabled' => ['google.com'],
    ],
```

You can add an extra middleware on the auth logins by adding them in the `google-authenticate.php` config file.

#### Custom middlewares

[](#custom-middlewares)

```
    'middleware' => [
        'web',
        CustomMiddleware::class
    ],
```

#### User table

[](#user-table)

You can customize how a user is saved. The config array `user_columns` will create the fillable data for your user. The array keys are your user column names, the array values are what should be stored. (Make sure the value is an array). You can add multiple values per key, these will be glued together. The following values would be filled by google's returned data, before being glued.

```
const GOOGLE_VALUES = [
        'name',
        'email_verified',
        'email',
        'given_name',
        'family_name',
        'picture',
        'nickname',
        'locale',
];
```

For example in your config:

```
'user_columns' => [
        'name' => ['name', ' (', 'locale', ')']     // John Doe (en)
        'email_verified_at' => ['email_verified'],  // 2019-10-23 14:31:50
        'email' => ['email'],                       // john@doe.com
        'other data' => ['blablabla'],              // blablabla
]
```

Publishing
----------

[](#publishing)

You can publish the views and translations files using:

```
php artisan vendor:publish --provider="Statikbe\\GoogleAuthenticate\\GoogleAuthenticateServiceProvider" --tag="google-views"
```

and

```
php artisan vendor:publish --provider="Statikbe\\GoogleAuthenticate\\GoogleAuthenticateServiceProvider" --tag="google-lang"
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License file](license.md) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance98

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~76 days

Recently: every ~121 days

Total

37

Last Release

7d ago

Major Versions

1.0.9 → 2.0.02019-09-17

2.0.3 → 3.0.02019-10-22

3.3.1 → 4.0.02021-12-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/1250437446b84017407f7f1900194b1e1c93fcf34b332ba382fb77f69b251cb6?d=identicon)[statikbe](/maintainers/statikbe)

---

Top Contributors

[![kristofser](https://avatars.githubusercontent.com/u/5928907?v=4)](https://github.com/kristofser "kristofser (66 commits)")[![AurelDemiri](https://avatars.githubusercontent.com/u/30560661?v=4)](https://github.com/AurelDemiri "AurelDemiri (3 commits)")[![Kobo-one](https://avatars.githubusercontent.com/u/11278919?v=4)](https://github.com/Kobo-one "Kobo-one (2 commits)")[![sten](https://avatars.githubusercontent.com/u/180665?v=4)](https://github.com/sten "sten (1 commits)")

---

Tags

laravelgooglesocialiteauthenticate

### Embed Badge

![Health badge](/badges/statikbe-laravel-google-authenticate/health.svg)

```
[![Health](https://phpackages.com/badges/statikbe-laravel-google-authenticate/health.svg)](https://phpackages.com/packages/statikbe-laravel-google-authenticate)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k11](/packages/laravel-surveyor)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2464.9k6](/packages/hasinhayder-tyro-login)

PHPackages © 2026

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