I seem to be getting an InvalidPayloadDataException when resolving this package via the service container.
The error seems to be that the TrackingId and ProtocolVersion are not being merged in when the service is resolved. Taking a dump of the resulting Analytics instance it seems these options are missing. However, everything is working fine if I use the Facade.
This has really stumped me. I am using the Facade as a workaround, but I would prefer to inject the service where possible.
Any thoughts would be greatly appreciated.
Usage Example
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use TheIconic\Tracking\GoogleAnalytics\Analytics;
class FooController extends Controller
{
/**
* Set up the controller.
*
* @param \TheIconic\Tracking\GoogleAnalytics\Analytics $analytics
* @return void
*/
public function __construct(Analytics $analytics)
{
// See below for result
dd($analytics);
}
}
Laravel version: v5.4.17 Package version: v1.2.0
I seem to be getting an
InvalidPayloadDataException
when resolving this package via the service container.The error seems to be that the
TrackingId
andProtocolVersion
are not being merged in when the service is resolved. Taking a dump of the resultingAnalytics
instance it seems these options are missing. However, everything is working fine if I use the Facade.This has really stumped me. I am using the Facade as a workaround, but I would prefer to inject the service where possible.
Any thoughts would be greatly appreciated.
Usage Example
Analytics instance
Stack Trace