Questions tagged [service-provider]
380 questions
0
votes
1 answer
Custom Package Repository Interface is not instantiable in Laravel 6
Target [MyPackage\Crm\App\Repositories\CommentRepositoryInterface] is not instantiable while building [MyPackage\Crm\App\Http\CommentController].
The Controller in question MyPackage\Crm\App\Http\CommentControllers.php works fine if I inject the…

ronline
- 2,211
- 1
- 20
- 27
0
votes
0 answers
ASP.NET Core - How to handle exception inside a scoped service
I have some repository classes added as scoped service and I retrieve a particular repository using:
var rep = HttpContext.RequestServices.GetService(typeof(interface));
That's ok... but when I call:
rep.Save();
Inside, in some validations, I…

Marcelo
- 1
- 1
0
votes
1 answer
Auth user check role is not working in serviceProvider Laravel
when i use (auth()->user()->hasRole('User')) or (Auth::user()->hasRole('User')) in service provider it gives me this error:
Call to a member function hasRole() on null
I use spatie library and include this in my serviceProvider file:
use…

Talha Maqsood
- 195
- 1
- 13
0
votes
0 answers
Is it possible to use a SID in the WinNT Service Provider?
Is there any way to use a SID in the WinNT service provider like:
// doesn't work
using (DirectoryEntry groupEntry = new DirectoryEntry("WinNT://./,group"))
{
}
or do I need to convert the SID to the group name first?
(Using…

marsh-wiggle
- 2,508
- 3
- 35
- 52
0
votes
1 answer
Proper way to create a service provider in Laravel
I am having trouble creating a service for my Laravel application. I wish to use this service to easily communicate with an API to perform IO operations. To be specific, my Laravel application needs to communicate with InvoiceNinja. There is an…

realnsleo
- 709
- 2
- 12
- 29
0
votes
1 answer
How to resovle problem view composer in laravel
config/app.php
'providers' => [
// ...
App\Providers\ViewServiceProvider::class,
App\Http\View\Composers\AdComposer::class,
],
app/Providers/ViewServiceProvider.php

Mehdi Jalali
- 183
- 1
- 2
- 9
0
votes
0 answers
Why this service provider's binding is not working?
I'm trying to alias the base model App\User with another, but the binding defined in the service provider is not working.
In the register() method of AppServiceProvider I have:
$this->app->bind(App\User::class, App\UserTest::class);
then when I try…

VdfX89
- 73
- 6
0
votes
1 answer
IDP initiated SSO fails with OKTA as an IDP in Azure
We have configured OKTA as an IDP in Azure AD. While testing the IDP(OKTA) authentication flow, it throws error.
Configured Okta & Azure AD using below microsoft link as…

Rajat
- 57
- 3
- 9
0
votes
3 answers
ASP.NET Core mock service only in scope of one request
Let's assume I have some service registered as scoped in the application startup and I want to replace it with another implementation only for single request.
Is there a way for achieving that?
Why I need it? because there is a case when I want…

Grigoryants Artem
- 1,401
- 2
- 15
- 32
0
votes
1 answer
Laravel package config does not merge
I am developing several packages and would like to have a single config file for all of them if they are to be published.
Inside my service provider I did this:
public function boot()
{
$this->publishes([
__DIR__ . '/config/custom.php'…

Norgul
- 4,613
- 13
- 61
- 144
0
votes
1 answer
Cannot resolve scoped service 'Services.Contracts.IHandler`1[Services.ProcessFile]' from root provider
I am creating handlers for net core background queue worker.
// Generic class, reused for different handlers
public class QueuedHostedService < T >: BackgroundService {
private readonly ILogger _logger;
private readonly…

user122222
- 2,179
- 4
- 35
- 78
0
votes
0 answers
ADFS EnableIdpInitiatedSignonpage property is missing
I am working on SAML authentication for my application using ADFS as IDP and IIS server as SP. ADFs has been setup on Windows 2012 R2.
The problem is " I can't access the ADFS Single Sing On page". this is the error that i am getting on adfs
Error -…

ashish gupta
- 135
- 5
- 16
0
votes
1 answer
What is the proper issuer of an oidc id token
What would the proper issuer be for implementing an oidc micro-service that will provide authorization for multiple clients differentiated by different domains?
The spec says:
REQUIRED. Issuer Identifier for the Issuer of the response. The iss
…

user1652802
- 1
- 1
- 2
0
votes
0 answers
ServiceProvider registered but not work in controller
I registered a ServiceProvider with easysms
app\Providers\EasySmsServiceProvider.php

DengSihan
- 2,119
- 1
- 13
- 40
0
votes
1 answer
Laravel package/service provider addition
I'm trying to use https://github.com/sebdesign/laravel-state-machine in my laravel application. But the package is not installed correctly. My controller doesn't recognise it.
First, I added the following to my composer.json
"repositories": [
{
…

marmahan
- 183
- 2
- 15