<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Translatable\HasTranslations;

class NewsCategory extends Model
{
    use HasTranslations; use SoftDeletes;
    const VISIBLE_Y = "顯示";
    const VISIBLE_N = "不顯示";
    protected $guarded = ['id'];


    public $translatable = ['name'];

    public function news(){
        return $this->hasMany(News::class);
    }
}
