Files
monica/app/Event.php
T
2017-02-16 19:21:44 -05:00

28 lines
582 B
PHP

<?php
namespace App;
use Auth;
use App\Reminder;
use App\Helpers\DateHelper;
use Illuminate\Database\Eloquent\Model;
class Event extends Model
{
public function getDescription()
{
if ($this->nature_of_operation == 'create') {
$description = 'You added ';
}
if ($this->nature_of_operation == 'update') {
$description = 'You updated ';
}
// You added a reminder about John Doe
if ($this->object_type == 'reminder') {
$reminder = Reminder::findOrFail($this->object_id);
}
}
}