Package Data | |
---|---|
Maintainer Username: | mpociot |
Maintainer Contact: | m.pociot@gmail.com (Marcel Pociot) |
Package Create Date: | 2016-05-25 |
Package Last Update: | 2022-11-16 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-17 03:03:06 |
Package Statistics | |
---|---|
Total Downloads: | 25,410 |
Monthly Downloads: | 4 |
Daily Downloads: | 0 |
Total Stars: | 19 |
Total Watchers: | 3 |
Total Forks: | 9 |
Total Open Issues: | 2 |
This package makes use of the SocialiteProviders
package located here.
composer require mpociot/socialite-slack
Remove Laravel\Socialite\SocialiteServiceProvider
from your providers[] array in config\app.php if you have added it already.
Add \SocialiteProviders\Manager\ServiceProvider::class
to your providers[] array in config\app.php.
Add SocialiteProviders\Manager\SocialiteWasCalled
event to your listen[] array in <app_name>/Providers/EventServiceProvider
.
The listener that you add for this provider is 'Mpociot\Socialite\Slack\SlackExtendSocialite@handle',
.
For example:
/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// add your listeners (aka providers) here
'Mpociot\Socialite\Slack\SlackExtendSocialite@handle',
],
];
If you add environment values to your .env
as exactly shown below, you do not need to add an entry to the services array.
// other values above
SLACK_KEY=yourkeyfortheservice
SLACK_SECRET=yoursecretfortheservice
SLACK_REDIRECT_URI=https://example.com/login
You do not need to add this if you add the values to the .env
exactly as shown above. The values below are provided as a convenience in the case that a developer is not able to use the .env method
'slack' => [
'client_id' => env('SLACK_KEY'),
'client_secret' => env('SLACK_SECRET'),
'redirect' => env('SLACK_REDIRECT_URI'),
],
Redirect to Slack with the scopes you want to access:
return Socialite::with('slack')->scopes([
'identity.basic',
'identity.email',
'identity.team',
'identity.avatar'
])->redirect();
MIT :)