PHP code example of insight-media / seotamic

1. Go to this page and download the library: Download insight-media/seotamic 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/ */

    

insight-media / seotamic example snippets


{{ seotamic }}



namespace App\ViewModels;

use Statamic\View\ViewModel;

class OgImage extends ViewModel
{
    public function data(): array
    {
        $image = $this->cascade->get('image');

        if ($image) {
            return [
                'seotamic_image' => $image
            ];
        }

        return [];
    }
}


php artisan vendor:publish --provider="Cnj\Seotamic\ServiceProvider" --tag=config