Error view:
Target [App\Services\OrderServiceInterface] is not instantiable.
Provider:
public function register()
{
$this->app->bind('App\Services\OrderServiceInterface', OrderService::class);
}
Where OrderServiceInterface is interface:
<?php
namespace App\Services;
interface OrderServiceInterface
{
public function doSomethingUseful();
}
And OrderService is a specific class:
<?php
namespace App\Services;
class OrderService implements OrderServiceInterface
{
public function doSomethingUseful()
{
return 'Output from DemoOne';
}
}
Usage:
public function accept(Request $request, OrderServiceInterface $orderService) {}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire