-
app/Services/Vimeo/VimeoServiceProvider.php
Open in GitHubuse GuzzleHttp\Client; use Illuminate\Support\ServiceProvider; class VimeoServiceProvider extends ServiceProvider { public function register(): void { app()->singleton(Vimeo::class, function () { return new Vimeo(new Client([ 'headers' => [ 'Authorization' => 'Bearer '.config('services.vimeo.access'), ], ])); }); } }
-
app/Services/GitHub/GitHubServiceProvider.php
Open in GitHubuse Github\Client; use Illuminate\Support\ServiceProvider; class GitHubServiceProvider extends ServiceProvider { public function register(): void { $this->app->singleton(GitHubApi::class, function () { $client = new Client(); $client->authenticate(config('services.github.token'), null, Client::AUTH_ACCESS_TOKEN); return new GitHubApi($client); }); } }