PHP code example of codemastersolucoes / laravel-visitor-tracker

1. Go to this page and download the library: Download codemastersolucoes/laravel-visitor-tracker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codemastersolucoes / laravel-visitor-tracker example snippets


protected $middlewareGroups = [
    ...
    'web' => [
        ...
        \CodeMaster\Laravel\VisitorTracker\Middleware\RecordVisits::class,
    ],
    ...
];

...
'providers' => [
    ...
    CodeMaster\Laravel\VisitorTracker\VisitorTrackerServiceProvider::class,
    ...
],
...

...
'aliases' => [
    ...
    'VisitStats' => CodeMaster\Laravel\VisitorTracker\Facades\VisitStats::class,
    ...
],
...

'visits_tracker' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'unix_socket' => env('DB_SOCKET', ''),
    'charset' => 'utf8mb4',
    'collation' => 'utf8mb4_unicode_ci',
    'prefix' => '',
    'strict' => true,
    'engine' => null,
],

'visits_tracker' => [
    'driver' => 'pgsql',
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', '5432'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'prefix' => '',
    'schema' => 'public',
    'sslmode' => 'prefer',
],

'visits_tracker' => [
    'driver' => 'sqlsrv',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '1433'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'collation' => 'SQL_Latin1_General_CP1_CI_AS',
    'prefix' => '',
],

QUEUE_DRIVER=database

VisitStats::routes();

Route::middleware('auth')->prefix('admin')->group(function () {
    VisitStats::routes();
});
bash
php artisan migrate
bash
php artisan vendor:publish
bash
php artisan queue:table
php artisan queue:failed-table
php artisan migrate
bash
php artisan queue:work