Skip to content

Commit 11ebdc3

Browse files
committed
improve data in querying contents
1 parent fd46991 commit 11ebdc3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/Darryldecode/Backend/Base/Registrar/Registrar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Registrar {
1313
/**
1414
* the laravel backend version
1515
*/
16-
const VERSION = '1.0.6';
16+
const VERSION = '1.0.7';
1717
const VERSION_NAME = 'Alpha';
1818

1919
/**

src/Darryldecode/Backend/Components/ContentBuilder/Models/Content.php

+15
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class Content extends BaseModel {
4747
'content_type_id' => 'required|numeric',
4848
);
4949

50+
/**
51+
* the custom fields of this content
52+
*
53+
* @var array
54+
*/
55+
protected $appends = ['custom_fields'];
56+
5057
/**
5158
* @param $req
5259
*/
@@ -79,6 +86,14 @@ public function getMiscDataAttribute()
7986
return (Helpers::is_serialized($this->attributes['misc_data'])) ? unserialize($this->attributes['misc_data']) : $this->attributes['misc_data'];
8087
}
8188

89+
/**
90+
* @return array
91+
*/
92+
public function getCustomFieldsAttribute()
93+
{
94+
return self::parseMetaData($this->metaData->toArray());
95+
}
96+
8297
/**
8398
* parse meta data to associative array
8499
*

0 commit comments

Comments
 (0)