1. Go to this page and download the library: Download litstack/meta 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/ */
litstack / meta example snippets
use Litstack\Meta\Metaable;
use Litstack\Meta\Traits\HasMeta;
class Post extends Model implements Metaable
{
use HasMeta;
}
public function show()
{
$page->card(function($form) {
$form->seo();
});
}
class Post extends Model implements Metaable
{
use HasMeta;
protected $metaAttributes = [
'author' => 'author.name',
'image' => 'header_image',
];
public function getHeaderImageAttribute()
{
// ...
}
public function metaTitle(): ?string
{
// Return a prefix:
return "Awesome Blog: " . parent::metaTitle();
}
}
class Post extends Model implements Metaable
{
use HasMeta;
protected $defaultMetaAttribute = [
'description' => 'description',
];
public function defaultMetaTitle()
{
}
}