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

ActiveLibrary

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

Google Authentication in Laravel

4.5.2(3mo ago)711.2k↓50%1MITPHP

Since Dec 9Pushed 3mo 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 1mo ago

READMEChangelog (6)Dependencies (3)Versions (40)Used By (0)

[![Card of Laravel Nova Chained Translation Manager](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

53

—

FairBetter than 97% of packages

Maintenance79

Regular maintenance activity

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 91.4% 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 ~87 days

Total

35

Last Release

109d 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 (64 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

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.2k124.3M624](/packages/barryvdh-laravel-debugbar)[socialiteproviders/manager

Easily add new or override built-in providers in Laravel Socialite.

42542.0M544](/packages/socialiteproviders-manager)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[revolution/laravel-bluesky

Bluesky(AT Protocol) for Laravel

4317.3k](/packages/revolution-laravel-bluesky)

PHPackages © 2026

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