Questions tagged [service-provider]

380 questions
9
votes
6 answers

Service Provider Interface without the Provider

I am reading Bloch's Effective java book[1] and came across the following example of SPI: //Service interface public interface Service { //Service specific methods here } //Service provider interface public interface Provider { Service…
oym
  • 6,983
  • 16
  • 62
  • 88
7
votes
1 answer

How to change the java DNS service provider

I'm building a fast web crawler and I need to have multithreaded DNS resolution, so I picked up a multithreaded DNS service provider called dnsjava. Unfortunately, I can't figure out how to replace the default DNS Service Provider. I went over the…
Kiril
  • 39,672
  • 31
  • 167
  • 226
7
votes
3 answers

How to access Laravel Singletons in a class?

I have registered a singleton in a service provider like so: $this->app->singleton(MyClass::class); This can normally be accessed by simply stating it in the parameters like so: class FooController extends Controller { public function…
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
7
votes
4 answers

Laravel 5.2 Error In Custom Authentication

I am getting error while making custom authentication for my laravel 5.2 however this code works fine on my laravel 5.1 My config/auth.php file 'providers' => [ 'users' => [ 'driver' => 'custom', 'model' => App\User::class, …
ujwal dhakal
  • 2,289
  • 2
  • 30
  • 50
7
votes
1 answer

How do I access the service provider when registering using typescript class

The following service provider registers successfully. Other controllers can use the service without trouble. My question is how to access the provider in order to configure it before the service is instantiated by the $injector service? module…
7
votes
2 answers

Confused - AppServiceProvider.php versus app.php

Where do I specify my bindings exactly? It seems I can do it in either of these files. config/app.php Inside of 'providers' => app/Providers/AppServiceProvider.php Inside of register()
user391986
  • 29,536
  • 39
  • 126
  • 205
7
votes
1 answer

SAML 2.0 SP metadata: Purpose and the use of certificate

Here is the part of SP metadata. Reference: Metadata for the OASIS Security Assertion Markup Language (SAML) V2.0 ...
tony.0919
  • 1,145
  • 5
  • 16
  • 27
7
votes
3 answers

Laravel - pass parameters through app->bind to model's constructor

Well, code describes it all. I've an Entity Service Provider, which pass an instance of Playlist Model, which supposed to get an array as it's first constructor parameter. How to pass that parameter through app->bind? Knowing that…
Omranic
  • 1,392
  • 3
  • 17
  • 32
7
votes
2 answers

Should I require IdP's to sign SAML2 SSO responses?

Our app has SAML2 SSO integration with 3 different (Shibboleth) IdP's. We are trying to add a 4th (also Shibboleth), but running into some issues, because our app expects all SSO responses to be verifiably signed. These other 3 are signing their…
danludwig
  • 46,965
  • 25
  • 159
  • 237
6
votes
2 answers

MarkupExtension.ProvideValue -- Is the IServiceProvider actually used?

I was going through some old code of mine and came across a hybrid IValueConverter / MarkupExtension class. It got me wondering if the IServiceProvider in the ProvideValue method was actually useful, and how it would be useful? I see that…
myermian
  • 31,823
  • 24
  • 123
  • 215
6
votes
1 answer

Laravel ServiceProvider vs. Middleware

I've got a question regarding Laravel. Where is the difference in using ServiceProviders or Middleware in Laravel? So I mean, when do I use ServiceProviders and when should I choose a Middleware? Both are executed on every request, don't they? Maybe…
dns_nx
  • 3,651
  • 4
  • 37
  • 66
6
votes
1 answer

Laravel service provider to retrieve data from database

I'm new to Laravel service provider, All I want is to pull the database data out and return it, so my config file can access to that data. How can I do this in Laravel service provider.
mana
  • 1,075
  • 1
  • 24
  • 43
6
votes
2 answers

Best location in Laravel for third-party API connection

I'm writing a Laravel application using one or more third-party APIs when it suddenly dawned on me. Where is the best place within the Laravel application structure to set up the API connection to consume it from my Controller? Would you use a…
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
6
votes
3 answers

How to bootstrap laravel 5 service providers from the vendor package itself?

I am working on a Laravel 5 application and now the code of the application is supposed to be re-used in multiple laravel 5 applications which is why I am creating a composer package and then I would like to install this package in any number of…
Rohan
  • 13,308
  • 21
  • 81
  • 154
6
votes
1 answer

Laravel package register exception handler

I wonder if it's possible to register a second Exception Handler in a package in Laravel 5. I have a package (let's call it api-serializer) that register a middleware to convert all requests to JSON (for an API) and this package register 2 helpers:…
kitensei
  • 2,510
  • 2
  • 42
  • 68
1
2
3
25 26