<?php

namespace App\Models;

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

class IndividualZone extends Model
{
    use LogsActivity;

    protected $fillable = [
        'main_title',
        'main_images',
        'background_color',
        'main_description',
        'game_count',
        'second_title',
        'button_text',
        'button_color',
        'button_background_color',
        'club_articles_heading',
        'article_count',
        'article_button_text',
        'article_button_color',
        'article_button_background_color',
    ];
    protected $casts = [
        'main_images' => 'array',
    ];

    public function games()
    {
        return $this->hasMany(\App\Models\Game::class, 'individual_zone_id');
    }

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