mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
init
This commit is contained in:
51
app/Providers/AppServiceProvider.php
Normal file
51
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Helpers\SSH;
|
||||
use App\Support\SocialiteProviders\DropboxProvider;
|
||||
use Illuminate\Contracts\Container\BindingResolutionException;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
ResourceCollection::withoutWrapping();
|
||||
|
||||
// facades
|
||||
$this->app->bind('ssh', function () {
|
||||
return new SSH;
|
||||
});
|
||||
|
||||
$this->extendSocialite();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
private function extendSocialite(): void
|
||||
{
|
||||
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
|
||||
$socialite->extend(
|
||||
'dropbox',
|
||||
function ($app) use ($socialite) {
|
||||
$config = $app['config']['services.dropbox'];
|
||||
|
||||
return $socialite->buildProvider(DropboxProvider::class, $config);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user