francescomalatesta / laravel-amplitude

A Laravel package to work with Amplitude.
MIT License
12 stars 14 forks source link

Exception : Driver "" not available #4

Open anassbaba opened 3 years ago

anassbaba commented 3 years ago

at /var/dev/jibly/vendor/francescomalatesta/laravel-amplitude/src/AmplitudeFactory.php:23

    19|
    20|     public function makeFor($driverName)
    21|     {
    22|         if (!in_array($driverName, array_keys($this->driversMap))) {
  > 23|             throw new \Exception(sprintf('Driver "%s" not available', $driverName));
    24|         }
    25|
    26|         $driver = $this->driversMap[$driverName];
    27|         return new Amplitude($driver);

"php": "^7.2", "laravel/framework": "^6.2",

prestonojb commented 3 years ago

Hi @anassbaba, try publishing the "LaravelAmplitude\Providers\LaravelAmplitudeServiceProvider" file with php artisan vendor:publish and the exception should be resolved.

hashcode7 commented 2 years ago

I have fixed this by adding a default driver so composer will not fail when installing the package.

You can use the following forked package instead that has this fix and also supports Php8 and Laravel9.

https://github.com/hashcode7/laravel-amplitude-analytics