I need to inject the service into the controller method like this:
namespace App\Controller;
use GeoIp2\Database\Reader;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class ApiController extends AbstractController
{
public function someAction(Reader $reader)
{
dd($reader);
}
}
but i'm have this error:
"Cannot autowire argument $reader of \"App\\Controller\\ApiController::someAction()\": it references class \"GeoIp2\\Database\\Reader\" but no such service exists. You should maybe alias this class to the existing \"geoip2.reader\" service."
Hi!
I need to inject the service into the controller method like this:
but i'm have this error:
is it possible to do it somehow?
thanx