Files
monica/app/Notification.php
T
2018-02-25 17:42:14 -05:00

60 lines
1.2 KiB
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* A notification is an email that is sent some days before a reminder is
* actually sent. Those days are defined by reminder rules.
*/
class Notification extends Model
{
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = ['id'];
protected $table = 'notifications';
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['trigger_date'];
/**
* Get the account record associated with the notification.
*
* @return BelongsTo
*/
public function account()
{
return $this->belongsTo(Account::class);
}
/**
* Get the contact record associated with the notification.
*
* @return BelongsTo
*/
public function contact()
{
return $this->belongsTo(Contact::class);
}
/**
* Get the reminder record associated with the notification.
*
* @return BelongsTo
*/
public function reminder()
{
return $this->belongsTo(Reminder::class);
}
}