PHP code example of cnj / seotamic

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

    

cnj / seotamic example snippets


{{ seotamic }}

{!! Statamic::tag('seotamic')->context(get_defined_vars()) !!}



namespace App\ViewModels;

use Statamic\View\ViewModel;

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

        if ($social) {
          return [ ...$social, 'image' => 'https://myimageurl.com/image.jpg', ];
        }

        return [];
    }
}
sh
php artisan seotamic:migrate

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