protected function isLoadedFromPivotTable(Model $item, $tableName)
    {
        return $item->pivot && $item->pivot->getTable() == $tableName;
    }
protected function isLoadedFromPivotTable(Model $item, $tableName)
    {
        return $item->pivot && $item->pivot->getTable() == $tableName;
    }
protected function isLoadedFromPivotTable ( Model $ item , $ tableName ) { return $ item -> pivot && $ item -> pivot -> getTable ( ) == $ tableName ; }
Check if the model instance is loaded from the provided pivot table.

@param Model $item
@param string $tableName

@return bool
Check if the model instance is loaded from the provided pivot table .