1. Go to this page and download the library: Download hyvor/laravel-json-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/ */
hyvor / laravel-json-meta example snippets
Schema::create('blogs', function (Blueprint $table) {
// other columns
$table->json('meta')->nullable();
});
use Hyvor\JsonMeta\HasMeta;
use Hyvor\JsonMeta\MetaDefinition;
class Blog extends Model
{
use HasMeta;
protected function defineMeta(MetaDefinition $meta)
{
// definition goes here
}
}
/**
* @param key-of<meta-of<Blog>> $key
*/
function handleMeta($key) {
// $key is a key of the meta definition of Blog
}
use Hyvor\JsonMeta\MetaDefinition;
public function defineMeta(MetaDefinition $meta)
{
// old definitions
// the new one
$meta->boolean('seo_follow_external_links')->default(false);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.