public function entity() { if ($this->entity_type === '') { $this->entity_type = null; } return $this->morphTo('entity'); }