<?php

namespace Yajny\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;
use Yajny\Traits\SelectTranslations;

class StoreContent extends Model
{
    use HasTranslations, SelectTranslations;

    protected $table = 'store_contents';
    protected $primaryKey = 'id';
    protected $guarded = ['id'];

    public $translatable = ['name', 'about_store', 'cb_terms', 'more_about_store_title', 'more_about_store', 'sp_terms_title', 'sp_terms', 'secrets', 'h1_tag', 'h2_tag', 'meta_title', 'meta_desc', 'meta_kw'];

    public static $nonReplaceableAttributes = ['id', 'store_id', 'region_code', 'created_at', 'updated_at'];

    public function store()
    {
        return $this->belongsTo(Store::class, 'store_id', 'id')->withoutGlobalScopes();
    }
}