Coder Social home page Coder Social logo

payping-oauth2-socialite-client's Introduction

payping-oauth2-socialite-client

1. Installation

composer require payping/payping-oauth2-socialite-client

2. Service Provider

Remove Laravel\Socialite\SocialiteServiceProvider from your providers[] array in config\app.php if you have added it already. Add php \SocialiteProviders\Manager\ServiceProvider::class to your providers[] array in config\app.php.

For example:

'providers' => [
    // a whole bunch of providers
    // remove 'Laravel\Socialite\SocialiteServiceProvider',
    \SocialiteProviders\Manager\ServiceProvider::class, // add
];
Note: If you would like to use the Socialite Facade, you need to install it.

3. Event Listener

Add SocialiteProviders\Manager\SocialiteWasCalled event to your listen[] array in app/Providers/EventServiceProvider. Add your listeners (i.e. the ones from the providers) to the SocialiteProviders\Manager\SocialiteWasCalled[] that you just created. The listener that you add for this provider is 'SocialiteProviders\PayPing\PayPingExtendSocialite@handle',. Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.

For example:

/**
 * The event handler mappings for the application.
 *
 * @var array
 */
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // add your listeners (aka providers) here
        'SocialiteProviders\\PayPing\\PayPingExtendSocialite@handle',
    ],
];

4. Configuration setup

You will need to add an entry to the services configuration file so that after config files are cached for usage in production environment (Laravel command artisan config:cache) all config is still available. Add to config/services.php.

'payping' => [
    'client_id' => env('PAYPING_CLIENT_ID'),
    'client_secret' => env('PAYPING_SECRET_ID'),
    'redirect' => env('REDIRECT_URL')
],

5. Usage

Laravel docs on configuration You should now be able to use it like you would regularly use Socialite (assuming you have the facade installed):

return Socialite::with('Payping')->redirect();

payping-oauth2-socialite-client's People

Contributors

farhad-lotfeali avatar

Watchers

James Cloos avatar  avatar

payping-oauth2-socialite-client's Issues

Could not find package payping/payping-oauth2-socialite-client.

composer require payping/payping-oauth2-socialite-client

also tried
composer require payping/payping-oauth2-socialite-client --dev

[InvalidArgumentException]
Could not find a matching version of package payping/payping-oauth2-socialite-client. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stabil
ity (dev).

"php": "^7.4",
"laravel/framework": "^7.0",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.