<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\Contracts\Activity;
use Spatie\Activitylog\LogOptions;

class Zone extends Model
{
	use HasFactory, LogsActivity;
	
	protected $table = 'zones';
	
	protected  $primaryKey = 'ZoneID';
	
	public $timestamps = false;
	
    protected $fillable = [
    'ZoneName'
  ];
  
  public function tapActivity(Activity $activity)
    {
        $activity->table_name = "zones";
    }
  
  public function getActivitylogOptions(): LogOptions
    {
        return LogOptions::defaults()
        ->logFillable()
		->logOnlyDirty(); //only the changed;
		//->logOnly(['ZoneName']);
    }
  
}
