<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AutomationLog extends Model
{
    protected $fillable = ['action', 'executed_at', 'details'];
    protected $casts = ['executed_at' => 'datetime'];

    public static function log($action, $details = null)
    {
        return self::create([
            'action' => $action,
            'executed_at' => now(),
            'details' => $details
        ]);
    }
}