voerro / laravel-visitor-tracker

Visitor tracker and statistics for Laravel 5.5+ (abandoned for the time being, feel free to take over)
67 stars 41 forks source link

Displaying stats not working #17

Closed lipasite closed 5 years ago

lipasite commented 5 years ago

Please explain how to see the statistics?

visitortracker.php

'layout' => 'layout',
'section_content' => 'content',

layout.php

 <section>
         <div>
                @include('layouts.dashboard') 
                @section('content')
                @endsection
        </div> 
 </section>

As I understand it, after declaring a section with a name that matches the config file of the tracker, statistics should appear in this section, but there is none.

web.php VisitStats::routes();

My route list

|        | GET|HEAD  | stats                                                   | visitortracker.summary          | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@summary       | web                |
|        | GET|HEAD  | stats/ajax                                              | visitortracker.ajax_requests    | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@ajaxRequests  | web                |
|        | GET|HEAD  | stats/all                                               | visitortracker.all_requests     | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@allRequests   | web                |
|        | GET|HEAD  | stats/bots                                              | visitortracker.bots             | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@bots          | web                |
|        | GET|HEAD  | stats/browsers                                          | visitortracker.browsers         | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@browsers      | web                |
|        | GET|HEAD  | stats/countries                                         | visitortracker.countries        | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@countries     | web                |
|        | GET|HEAD  | stats/languages                                         | visitortracker.languages        | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@languages     | web                |
|        | GET|HEAD  | stats/login-attempts                                    | visitortracker.login_attempts   | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@loginAttempts | web                |
|        | GET|HEAD  | stats/os                                                | visitortracker.os               | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@os            | web                |
|        | GET|HEAD  | stats/unique                                            | visitortracker.unique           | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@unique        | web                |
|        | GET|HEAD  | stats/urls                                              | visitortracker.urls             | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@urls          | web                |
|        | GET|HEAD  | stats/users                                             | visitortracker.users            | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@users         | web                |
|        | GET|HEAD  | stats/visits                                            | visitortracker.visits           | \Voerro\Laravel\VisitorTracker\Controllers\StatisticsController@visits        | web

I go to the /stats URL but nothing happens - I see my dashboard as before - unchanged. At the same time, in Laravel DebugBar, I see requests for obtaining statistics on the visitortracker_visits table.

P.S. visitortracker_visits table works correctly - I see all stats data collected at MySql DB. I have more 20 records.

Можешь объяснить по-русски? :)

MouadBH commented 5 years ago

Thats a simple way to do it. visitortracker.php

'layout' => 'layout',
'section_content' => 'content', 

layout.blade.php

<section>
         <div>
               @yield('content')
        </div> 
 </section>
lipasite commented 5 years ago

@MouadBH Thank you! It works!