<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Report extends Model
{
protected $fillable = ['reportable_id', 'reportable_type', 'user_id'];
public function comments()
{
return $this->morphMany(\App\Models\Comment::class, 'reportable');
}
public static function addNew($data)
{
$report = self::create($data);
return $report;
}
public function remove()
{
$this->delete();
}
}