32 lines
632 B
PHP
32 lines
632 B
PHP
<?php namespace App\Models;
|
|
|
|
/*
|
|
Attendize.com - Event Management & Ticketing
|
|
*/
|
|
|
|
/**
|
|
* Description of Message
|
|
*
|
|
* @author Dave
|
|
*/
|
|
class Message extends MyBaseModel {
|
|
|
|
public function event() {
|
|
return $this->belongsTo('\App\Models\Event');
|
|
}
|
|
|
|
public function getRecipientsLabelAttribute() {
|
|
if($this->recipients == 0) {
|
|
return 'All Attendees';
|
|
}
|
|
|
|
$ticket = Ticket::scope()->find($this->recipients);
|
|
return 'Ticket: '.$ticket->title;
|
|
}
|
|
|
|
public function getDates() {
|
|
return array('created_at', 'updated_at', 'sent_at');
|
|
}
|
|
|
|
}
|