Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /home/fdshops/public_html/Modules/Cms/Entities/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/fdshops/public_html/Modules/Cms/Entities/CmsPageMeta.php
<?php

namespace Modules\Cms\Entities;

use Illuminate\Database\Eloquent\Model;

class CmsPageMeta extends Model
{
    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    protected $guarded = ['id'];

    /**
     * Get the page for the meta.
     */
    public function page()
    {
        return $this->belongsTo('Modules\Cms\Entities\CmsPage', 'cms_page_id');
    }

    /**
     * Update or create meta data for given page
     */
    public static function updateOrCreateMetaForPage($metas, $page_id)
    {
        if (! empty($metas) && ! empty($page_id)) {
            foreach ($metas as $meta_key => $meta_value) {
                CmsPageMeta::updateOrCreate(
                    ['id' => $meta_value['id'], 'cms_page_id' => $page_id, 'meta_key' => $meta_key],
                    ['meta_value' => json_encode($meta_value)]
                );
            }
        }
    }
}

Spamworldpro Mini