protected function subject($notification) { return $this->hasOne($notification, function ($notification) { return static::$subjectSerializers[$notification->type]; }); }