Bring up-to-date and simple Socialite support to your Filament admin panel with this plugin. Adds OAuth buttons to your login page.
Ideal for Laravel and Filament users seeking a straightforward OAuth integration.
Warning
Socialment is currently in beta. Please report any issues you encounter. Caution is advised if you choose to use this package in production. Azure AD support has been the only tested provider so far.
This package extends Laravel Socialite. Socialite currently supports authentication via Facebook, Twitter, LinkedIn, Google, GitHub, GitLab, and Bitbucket out of the box.
Refer to the Socialite documentation for more information on how to configure your application to use these providers.
Many other providers are available via the Socialite Providers website. Refer to the documentation for each provider for information on how to configure your application to use them.
For an example usage of this package, see ChrisReedIO/Socialment-Demo.
You can install the package via composer:
composer require chrisreedio/socialment
Warning
You must set "minimum-stability": "dev",
in your composer.json while Socialment is still in Beta.
After installation you should publish and run the migration(s) with:
Important
This package requires that the users
password
field be nullable. If you have not already done so, you should update your users
table migration to make this change.
php artisan vendor:publish --tag="socialment-migrations"
php artisan migrate
Then publish the config file with:
php artisan vendor:publish --tag="socialment-config"
Whether you're using the default providers or adding your own, you'll need to configure them in the socialment.php
config file.
Configure the socialment.php
config file to specify providers in the following format:
return [
'providers' => [
'azure' => [
'icon' => 'fab-microsoft', // Font Awesome Brand Icon
'label' => 'Azure', // Display Name on the Login Page
]
],
// ... Other Configuration Parameters
];
This package also uses the Blade Font Awesome package by Owen Voke.
Search for brand icons on the Font Awesome Website.
Include this plugin in your panel configuration:
$panel
->plugins([
// ... Other Plugins
\ChrisReedIO\Socialment\SocialmentPlugin::make(),
])
By default, the plugin displays the configured providers at the bottom of the login form.
You can additionally override the visibility of the plugin by passing a boolean or closure to the visible
method:
$panel->plugins([
\ChrisReedIO\Socialment\SocialmentPlugin::make()
->visible(fn () => false)
]);
You may publish and customize the views using
php artisan vendor:publish --tag="socialment-views"
This is the contents of the published config file:
return [
'view' => [
// Set the text above the provider list
'prompt' => 'Or Login Via',
// Or change out the view completely with your own
'providers-list' => 'socialment::providers-list',
],
'routes' => [
'home' => 'filament.admin.pages.dashboard',
],
'models' => [
// If you want to use a custom user model, you can specify it here.
'user' => \App\Models\User::class,
],
'providers' => [
'azure' => [
'icon' => 'fab-microsoft',
'label' => 'Azure Active Directory',
]
],
];
Note
Tests have yet to be written for this package. They are on my TODO list. I'm also open to PRs.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.