added php sandbox and some helper funcs to models
This commit is contained in:
@@ -25,4 +25,17 @@ trait Reportable
|
||||
{
|
||||
return $this->morphMany(ContentReport::class, 'object');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a report of this object to the DB
|
||||
*
|
||||
* @param string $message explanation why it should be removed
|
||||
*/
|
||||
public function reportAsInappropriate($message)
|
||||
{
|
||||
$this->reportsOf()->save(new ContentReport([
|
||||
'author_id' => \Auth::user()->getKey(),
|
||||
'message' => $message,
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user