<?php

namespace App\Models\Webprofile;

use App\Http\Traits\UuidTrait;
use App\Models\Webprofile\De\Posts as DePosts;
use App\Models\Webprofile\En\Posts as EnPosts;
use App\Models\Webprofile\Sa\Posts as SaPosts;
use App\Models\Webprofile\Zh\Posts as ZhPosts;
use Illuminate\Database\Eloquent\Model;

class Posts extends Model
{
    use UuidTrait;

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

    protected $guarded = [];

    public function rCategory()
    {
        return $this->belongsTo(Categories::class, 'categories', 'id');
    }

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

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

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

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