Illuminate\Database\Eloquent\Model::getBelongsToManyCaller PHP Method

getBelongsToManyCaller() protected method

Get the relationship name of the belongs to many.
protected getBelongsToManyCaller ( ) : string
return string
    protected function getBelongsToManyCaller()
    {
        $self = __FUNCTION__;
        $caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace) use($self) {
            $caller = $trace['function'];
            return !in_array($caller, Model::$manyMethods) && $caller != $self;
        });
        return !is_null($caller) ? $caller['function'] : null;
    }
Model