matondojk / filament-social-login
A beautiful, plug-and-play social login integration for modern Filament PHP panels.
Package info
github.com/matondojk/filament-social-login
pkg:composer/matondojk/filament-social-login
Requires
- php: ^8.1
- filament/filament: ^3.0|^4.0|^5.0
- laravel/socialite: ^5.0
- socialiteproviders/manager: ^4.0
README
A beautiful, plug-and-play social login integration for modern Filament PHP panels (v3/v4/v5). Supports Google, Facebook, GitHub, LinkedIn, and Microsoft OAuth seamlessly, and automatically retrieves user avatars.
Light Mode
Dark Mode
Table of Contents
Installation
- Install the package via composer:
composer require matondojk/filament-social-login
- Publish the configuration and migration:
php artisan vendor:publish --tag="filament-social-login-config" php artisan vendor:publish --tag="filament-social-login-migrations"
(You can also publish views and translations if you want to customize them)
php artisan vendor:publish --tag="filament-social-login-views" php artisan vendor:publish --tag="filament-social-login-translations"
- Run the migrations:
php artisan migrate
- Prepare your User Model to accept the new fields and display the Avatar:
In
app/Models/User.php, implement theHasAvatarinterface:
use Filament\Models\Contracts\HasAvatar; class User extends Authenticatable implements HasAvatar { protected $fillable = [ 'name', 'email', 'password', 'provider', 'provider_id', 'avatar_url' // <-- add the new fields ]; public function getFilamentAvatarUrl(): ?string { return $this->avatar_url; } }
- Register the plugin in your Panel Provider (e.g.,
app/Providers/Filament/AdminPanelProvider.php):
use Matondojk\FilamentSocialLogin\FilamentSocialLoginPlugin; public function panel(Panel $panel): Panel { return $panel ->plugin(FilamentSocialLoginPlugin::make()) // ... }
Configuration
In your .env file, you can enable/disable providers and set your credentials. Only enabled providers will be shown on the login screen. The package automatically injects these into config/services.php for you!
SOCIAL_LOGIN_REDIRECT=/admin SOCIAL_LOGIN_GOOGLE_ENABLED=true SOCIAL_LOGIN_FACEBOOK_ENABLED=false SOCIAL_LOGIN_GITHUB_ENABLED=false SOCIAL_LOGIN_LINKEDIN_ENABLED=true SOCIAL_LOGIN_MICROSOFT_ENABLED=true GOOGLE_CLIENT_ID=your-client-id GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_REDIRECT_URI="${APP_URL}/auth/google/callback"
Obtaining Social Credentials
For instructions on how to create the OAuth apps and obtain the CLIENT_ID and CLIENT_SECRET for each provider, please refer to the official Laravel Socialite Documentation (v13.x).
Note: Ensure your exact REDIRECT_URI (e.g., https://your-app.com/auth/google/callback) is added to the allowed redirect URIs in the provider's developer console!
Microsoft & LinkedIn Support
This package relies on Laravel Socialite natively for Google, Facebook and GitHub. For Microsoft and LinkedIn OpenID, be sure to install the community providers if you need them:
composer require socialiteproviders/microsoft socialiteproviders/linkedin-openid
License
MIT

