antonioribeiro / tracker

Laravel Stats Tracker
MIT License
2.88k stars 599 forks source link

Class 'Tracker' not found #44

Open AMAFsoft opened 9 years ago

AMAFsoft commented 9 years ago

I'am using namespace in my controllers , this is my controller : [controllers/admin/AdminController.php]

theme = Theme::uses('admin'); $visitor = Tracker::currentSession(); dd($visitor); } public function getIndex() { $the_title = trans("admin.labels.dashboard"); return $this->theme->scope('index',compact('the_title')) ->render(); } ``` }
antonioribeiro commented 9 years ago

I namespace my controllers too and I don't have any problems. Looks like at the time your controller was hit the alias wasn't still registered, you can do it manually in your app.php:

'Tracker' => 'PragmaRX\Tracker\Vendor\Laravel\Facade',

Tracker Service Provider does that for you automatically, unless you tell it to not to, in config.php, it also let you change the Alias name...

AMAFsoft commented 9 years ago

Ah yes, but this is not exist in the documentation i think, Thank you very mach sir

antonioribeiro commented 9 years ago

It does not exists because you should not need to do this, Tracker is supposed to do it automatically for you. But somehow in your application the controller is being hit before Tracker is able to create the Alias...

AMAFsoft commented 9 years ago

Ah sorry ! Thank you again sir

idfluid commented 9 years ago

please help me, i'am found an error like this

Database [tracker] not configured. (View: C:\xampp\htdocs\project\ayam_jago\app\views\admin\page\visitor\index.blade.php)

antonioribeiro commented 9 years ago

You need a 'tracker' connection in your app/conf/databases.php file, pointing to whatever database you want Tracker to write to. It can be your main database or a separate one.

AMAFsoft commented 9 years ago

Change 'tracker' to 'mysql' in the config file. app/config/packages/pragmarx/tracker/config.php

antonioribeiro commented 9 years ago

Or this :)

idfluid commented 9 years ago

Thank you very mach sir

hoeril commented 8 years ago

hello sir, i found error like this

ReflectionException in Container.php line 734:
Class PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker does not exist

thanks,

epalen commented 8 years ago

Good morning.

Hello, I have a similar hoeril error, I am using Laravel 5.2

The error message is:

ReflectionException in Container.php line 734:
Class PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker does not exist
MishukAdhikari commented 5 years ago

I namespace my controllers too and I don't have any problems. Looks like at the time your controller was hit the alias wasn't still registered, you can do it manually in your app.php:

'Tracker' => 'PragmaRX\Tracker\Vendor\Laravel\Facade',

Tracker Service Provider does that for you automatically, unless you tell it to not to, in config.php, it also let you change the Alias name...

I am using Laravel 5.7 the same thing happening to me the error is saying Class tracker does not exist though I've added the alias already in config/app.php also cleared cache updated composer and tried composer dump-autoload seems doesn't work.