PHP code example of tnlmedia / laravel-tool

1. Go to this page and download the library: Download tnlmedia/laravel-tool 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/ */

    

tnlmedia / laravel-tool example snippets


// Set page targeting
$key = 'targeting-key';
$list = ['value1', 'value2'];
TMGBlade::setTargeting($key, $list);

// In blade <head> for advertising core javascript
{!! TMGBlade::renderHeader() !!}

// In blade slot position
// You can override config if need
{!! TMGBlade::renderSlot('sample', [
    'targeting' => [
        'key1' => ['value1'],
        'key2' => ['value2', 'value3'],
    ],
]) !!}
shell
php artisan vendor:publish --tag=tmg-config