Skip to content

Instantly share code, notes, and snippets.

@nonlocalize
Last active August 29, 2015 14:15
Show Gist options
  • Save nonlocalize/13cb668766e63f619026 to your computer and use it in GitHub Desktop.
Save nonlocalize/13cb668766e63f619026 to your computer and use it in GitHub Desktop.
trait DocumentTrait
{
public function markSent()
{
$this->status = 1;
$this->save();
}
public function markDecision($data)
{
if(isset($data['accept']))
{
$this->status = 2;
$this->decision_date = date('d-m-Y');
$this->save();
return true;
}
if(isset($data['decline']))
{
$this->status = 3;
$this->decision_date = date('d-m-Y');
$this->save();
return true;
}
}
public function client()
{
return $this->belongsTo('Client');
}
public function user()
{
return $this->belongsTo('User');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment