<?php

namespace App\Models\Webprofile;

use App\Http\Traits\UuidTrait;
use App\Models\Webprofile\De\Categories as DeCategories;
use App\Models\Webprofile\En\Categories as EnCategories;
use App\Models\Webprofile\Sa\Categories as SaCategories;
use App\Models\Webprofile\Zh\Categories as ZhCategories;
use Illuminate\Database\Eloquent\Model;

class Categories extends Model
{
    use UuidTrait;

    public $incrementing = false;
    protected $table = 'swp_categories';

    protected $guarded = [];

    public function berita()
    {
        return $this->hasMany(Posts::class, 'id', 'categories');
    }

    public function rEn()
    {
        return $this->hasOne(EnCategories::class, 'category_id', 'id');
    }

    public function rDe()
    {
        return $this->hasOne(DeCategories::class, 'category_id', 'id');
    }

    public function rSa()
    {
        return $this->hasOne(SaCategories::class, 'category_id', 'id');
    }

    public function rZh()
    {
        return $this->hasOne(ZhCategories::class, 'category_id', 'id');
    }
}
