1. Go to this page and download the library: Download dishark/metaeloquent 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/ */
dishark / metaeloquent example snippets
// file START omitted
'providers' => [
// other providers omitted
'Dishark\Metaeloquent\MetaEloquentServiceProvider',
],
// file END omitted
App\Post;
use Dishark\Metaeloquent\Traits\MetaTrait;
class Post {
use MetaTrait;
protected $metaAttributes = [
'author' => 'author',
'description' => 'title',
'keywords' => 'keywords',
];
}
App\Post;
use Dishark\Metaeloquent\Traits\MetaTrait;
class Post {
use MetaTrait;
protected $metaAttributes = [
'author' => 'author',
'description' => 'title',
'keywords' => 'keywords',
];
public function getMetaAuthor()
{
return $this->author->name;
}
}