Posts.php 567 Bytes
Newer Older
1 2 3 4 5 6 7
<?php

namespace App\Models\Webprofile;

use App\Http\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Model;
use App\Models\Webprofile\Categories;
8
use App\Models\Webprofile\En\Posts as EnPosts;
9 10 11 12 13 14 15 16 17 18

class Posts extends Model
{
    use UuidTrait;

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

    protected $guarded = [];

19
    public function rCategory()
20 21 22
    {
        return $this->belongsTo(Categories::class, 'categories', 'id');
    }
23 24 25 26 27

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