Facade isn't working
Hi
I tried to use the facade with this code:
Tracker::currentSession()
But it returns this:
Class 'App\Http\Controllers\Tracker' not found
I included it in my app.php config file like this;
'Tracker' => PragmaRX\Tracker\Vendor\Laravel\Facade::class,
Any ideas?
use Tracker;
Call to undefined method PragmaRX\Tracker\Vendor\Laravel\Facade::currentSession()
Also with the use Tracker; included.
Perhaps missing the provider in config/app.php ?
'providers' => [
PragmaRX\Tracker\Vendor\Laravel\ServiceProvide::class,
]
'aliases' => [
'Tracker' => PragmaRX\Tracker\Vendor\Laravel\Facade::class,
]
PragmaRX\Tracker\Vendor\Laravel\ServiceProvider::class, is in my providers. So I really don't know why it isn't working. I just followed the steps from the readme.md.
Having the same problem since the update to Laravel 5.4
how do you add geoip facades and alias. thank you?
I'm having the same issue. Any solution please ?
guys just enable logging and everything will work
still no solution?
@hamzafaouzi which log should be enable?
@kevingio
'log_enabled' => false,
try changing this to
'log_enabled' => true,
@napestershine I believe this bug can be fixed with this change:
src/Vendor/Laravel/ServiceProvider.php
protected function registerTracker()
{
- $this->app->singleton('tracker', function ($app) {
+ $this->app->singleton(Tracker::class, function ($app) {
$app['tracker.loaded'] = true;
return new Tracker(
$app['tracker.config'],
$app['tracker.repositories'],
$app['request'],
$app['router'],
$app['log'],
$app,
$app['tracker.messages']
);
});
+ $this->app->alias(Tracker::class, 'tracker');
}