belongsTo(User::class); } /** * Dynamically resolve the related model instance */ public function relatedModel() { if (!class_exists($this->model)) { return null; } return $this->model::find($this->model_id); } }