1. Go to this page and download the library: Download freshwork/metable 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/ */
$post->getMeta('key'); // ['value']
$post->getMeta('foo'); // [ ['bar', 'baz'] ]
$post->getMeta('third'); // [ 'value1', 'values2' ]
//If you want to get the first element of the array
$post->getMeta('key', true); // 'value'
$post->getMeta('foo', true); // ['bar', 'baz']
$post->getMeta('third', true); // 'value1'
//Load $post->metadata variable
$post->loadMeta();
//Then you can
dd($post->metadata->key); //['value']
//Load $post->metadata variable
$post->removeMeta('key'); //remove all the ocurrences of metas with that key in the current model
bash
php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.