<?php

namespace App;

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


class Eoffice extends Model
{
    use HasFactory;

    protected $dates = ['deleted_at'];

    protected $fillable = ['judul','konten'];

    // public function katartikel()
    // {
    //     return $this->belongsTo('App\Katartikel');
    // }

     public function user()
     {
         return $this->belongsTo('App\User');
     }
   
     public function artikel()
     {
         return $this->hasMany('App\Artikel');
     }

     protected static function booted()
     {
            parent::boot();

            static::creating(function ($eoffice) {
                $eoffice->user_id = auth()->user()->id;
            });
    }


  
}
