for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the HRis Software package.
*
* NOTICE OF LICENSE
* Licensed under the 3-clause BSD License.
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
* @version alpha
* @author Bertrand Kintanar <[email protected]>
* @license BSD License (3-clause)
* @copyright (c) 2014-2016, b8 Studios, Ltd
* @link http://github.com/HB-Co/HRis
*/
namespace HRis\Providers;
use Dingo\Api\Auth\Auth;
use Dingo\Api\Auth\Provider\OAuth2;
use Illuminate\Support\ServiceProvider;
use Irradiate\Eloquent\User;
class OAuthServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
* @return void
public function boot()
$this->app[Auth::class]->extend('oauth', function ($app) {
$provider = new OAuth2($app['oauth2-server.authorizer']->getChecker());
$provider->setUserResolver(function ($id) {
return User::findOrFail($id);
});
$provider->setClientResolver(function ($id) {
return $provider;
}
* Register any application services.
public function register()
//