<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use App\Traits\ModelLogChanging;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class MailEvent extends Model
{
    use ModelLogChanging;

    protected $fillable = ['name', 'event_name', 'remark', 'is_active', 'template'];

    /**
     * @return BelongsToMany
     */
    public function roles(): BelongsToMany
    {
        return $this->belongsToMany(Role::class,'mail_event_role','mail_event_id','role_id');
    }
}
