<?php

namespace App\Models\Core\Mail;

use App\Repositories\Core\DateTime;
use Illuminate\Database\Eloquent\Model;

class MailLog extends Model
{
    protected $guarded = ['id'];

    public function scopeByDestination($query, $email)
    {
        return $query->where('sent_to', $email);
    }

    public function getCreatedAtAttribute($value)
    {
        return DateTime::DateTimeToLocale($value);
    }
}
