✨ Refactor Trakt configuration to use config file and dependency injection
This commit is contained in:
parent
347c0330b1
commit
caa1f0e442
5 changed files with 32 additions and 19 deletions
|
|
@ -7,6 +7,7 @@ use Illuminate\Support\ServiceProvider;
|
|||
use Illuminate\Contracts\Queue\Factory as QueueFactoryContract;
|
||||
use App\Queue\DatabaseConnector;
|
||||
use App\Services\Trakt;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -29,6 +30,6 @@ class AppServiceProvider extends ServiceProvider
|
|||
public function register()
|
||||
{
|
||||
$this->app->instance(ProcessInput::class, new ProcessInput());
|
||||
$this->app->instance(Trakt::class, new Trakt());
|
||||
$this->app->singleton(Trakt::class, fn ($app) => new Trakt($app->make(Repository::class)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue