Fenos\Notifynder\Models\Notification::to PHP Method

to() public method

public to ( ) : BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo
return Illuminate\Database\Eloquent\Relations\BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo
    public function to()
    {
        // check if on the configurations file there is the option
        // polymorphic set to true, if so Notifynder will work
        // polymorphic.
        if (config('notifynder.polymorphic') == false) {
            return $this->belongsTo(config('notifynder.model'), 'to_id');
        }
        return $this->morphTo();
    }