I have created a class called Provider
class Provider
{
private $provider;
public function __construct(ProviderInterface $provider)
{
$this->provider = $provider;
}
}
In the factory class, I have like this:
return app()->makeWith(Provider::class, [app(ProviderName::class)]);
I use makeWith to allow you pass the parameter.
However I get an error:
Target [App\Services\ProviderInterface] is not instantiable while building [App\Services\Provider].
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire