Travel Guide Frontend Backend

This commit is contained in:
Kevin Adametz 2020-08-07 16:00:55 +02:00
parent e6cc042aee
commit 0857a34766
681 changed files with 6680 additions and 1689 deletions

View file

@ -57,6 +57,12 @@ use Illuminate\Support\Str;
* @property-read int|null $iq_content_tree_node_childs_count
* @property string|null $title
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereTitle($value)
* @property array|null $image
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereImage($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faq
* @property-read int|null $iq_content_faq_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faqs
* @property-read int|null $iq_content_faqs_count
*/
class IQContentTreeNode extends Model
{
@ -70,10 +76,10 @@ class IQContentTreeNode extends Model
protected $table = 'i_q_content_tree_nodes';
protected $fillable = [
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'title', 'description', 'settings', 'pos', 'active',
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'title', 'description', 'settings', 'image', 'pos', 'active',
];
protected $casts = ['settings' => 'array'];
protected $casts = ['settings' => 'array', 'image' => 'array'];
public function sluggable()
{
@ -104,6 +110,11 @@ class IQContentTreeNode extends Model
return $this->hasMany('App\Models\IQContentSite', 'tree_node_id', 'id');
}
public function iq_content_faqs()
{
return $this->hasMany('App\Models\IQContentFaq', 'tree_node_id', 'id');
}
public function iq_content_site_first()
{
foreach ($this->iq_content_sites as $iq_content_site) {
@ -142,7 +153,12 @@ class IQContentTreeNode extends Model
return $ret.$node_parent->identifier."/";
}
}
public function getImage($key){
if(isset($this->image[$key])){
return $this->image[$key];
}
return "";
}
public static function getTreeNodeOptions($tree_id, $id = false, $html = true, $choose = true) {
$values = [];