Skip to content

Commit

Permalink
Modification du Service Provider et suppression de la facade
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Bertolucci committed Sep 1, 2021
1 parent 2440492 commit b16e130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/PennylaneLaravelFacade.php

This file was deleted.

6 changes: 4 additions & 2 deletions src/PennylaneLaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Ashraam\PennylaneLaravel;

use GuzzleHttp\Client;
use Illuminate\Support\ServiceProvider;
use Ashraam\PennylaneLaravel\PennylaneLaravel;

class PennylaneLaravelServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -52,15 +54,15 @@ public function register()
// Automatically apply the package configuration
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'pennylane-laravel');

$client = new \GuzzleHttp\Client([
$client = new Client([
'base_uri' => config('pennylane-laravel.endpoint'),
'headers' => [
"Authorization" => "Bearer ".config('pennylane-laravel.key')
]
]);

// Register the main class to use with the facade
$this->app->singleton('pennylane-laravel', function () use ($client) {
$this->app->singleton(PennylaneLaravel::class, function () use ($client) {
return new PennylaneLaravel($client);
});
}
Expand Down

0 comments on commit b16e130

Please sign in to comment.