<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Berita extends Model
{
    use HasFactory;
    protected $table = 'beritas';
    protected $fillable = [
        'judul',
        'isi',
        'tanggal',
        'thumbnail',
        'created_by'
    ];

    public function author(){
        return $this->belongsTo("App\Models\User", "created_by", "id");
    }
}
