PHP code example of orlserg / utm-recorder

1. Go to this page and download the library: Download orlserg/utm-recorder 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/ */

    

orlserg / utm-recorder example snippets


    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \App\Http\Middleware\EncryptCookies::class,
        \Kyranb\Footprints\Middleware\CaptureAttributionDataMiddleware::class,
    ];

    // your own visitor table
    'link_visits_with' => 'visitors',

    // your own visitor model
    'link_visits_with_model' => \App\Visitor::class,

    public function visits()
    {
        return $this->HasMany(Visit::class, 'owner_id', 'id');
    }
 php

    'providers' => [
        ...
        \Orlserg\UtmRecorder\UtmRecorderServiceProvider::class,
    ],

...

    'aliases' => [
        ...
        'UtmRecorder' => \Orlserg\UtmRecorder\UtmRecorderFacade::class,
    ],

 php
php artisan vendor:publish --provider="Orlserg\UtmRecorder\UtmRecorderServiceProvider"
 bash
$ php artisan migrate