Skip to content

Instantly share code, notes, and snippets.

@ashokgelal
Created March 12, 2017 00:39
Show Gist options
  • Save ashokgelal/fc57f175ed7e128c8bd884641dc96e03 to your computer and use it in GitHub Desktop.
Save ashokgelal/fc57f175ed7e128c8bd884641dc96e03 to your computer and use it in GitHub Desktop.
Extend Monitor to add a raw_url attribute
class LinkMonitor extends Monitor
{
protected $table = 'monitors';
protected $appends = ['raw_url'];
/**
* @return string
*/
public function getRawUrlAttribute()
{
if (! isset($this->attributes['url'])) {
return;
}
return $this->attributes['url'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment