<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class NewEventContain extends Model
{
    use LogsActivity;

    //
    protected $fillable = [
        'new_event',
        'image',
        'title',
        'released_at',
        'description',
        'author',
        'individual_zone_id',
        'game_id',
    ];
    protected $casts = [
        'released_at' => 'datetime',
    ];

    public function individualZone()
    {
        return $this->belongsTo(IndividualZone::class);
    }
    public function game()
    {
        return $this->belongsTo(Game::class);
    }

    public function getActivitylogOptions(): \Spatie\Activitylog\LogOptions
    {
        return \Spatie\Activitylog\LogOptions::defaults()->logAll();
    }
}
