Resolve table name.

@param  \Illuminate\Database\Eloquent\Model  $entity
@param  string|null  $name

@return string|null
967413
protected function bindWithKey(Model $entity, ?string $name): ?string
    {
        if (\is_null($name) || (\strpos($name, '{') === false && \strpos($name, '}') === false)) {
            return $name;
        }

        $id = $entity->getKey();

        if (! isset($this->data[$id])) {
            $data = \array_merge(Arr::dot(['entity' => $entity->toArray()]), \compact('id'));

            $this->data[$id] = $data;
        }

        return Str::replace($name, $this->data[$id]);
    }
476272
public function getTable($name = '')
    {
        if ($name || empty($this->table)) {
            $name      = $name ?: $this->name;
            $tableName = $this->prefix;
            if ($name) {
                $tableName .= Parse::parseName($name);
            }
        } else {
            $tableName = $this->table;
        }
        return $tableName;
    }
820394
protected function name(Eloquent $entity = null)
    {
        return app('translator')->has($key = $this->translationKey())
            ? trans($key)
            : title_case(str_replace('_', ' ', snake_case(class_basename($this))));
    }
1063351
protected function getReferencingModel($name)
    {
        if (!$this->isRelationMapped($name)) {
            return null;
        }

        $table = $this->getReferencingTable($name);
        $model = static::getModelFromTable($table);

        return $model;
    }
932375
public function getTableName($model = null)
    {
        $model = $model ?? $this->model;

        if ($model instanceof Model) {
            return $model->getTable();
        } elseif ($model instanceof EloquentBuilder) {
            return $model->getModel()->getTable();
        }

        return $model->from;
    }
1000193
public function getProperty($name)
    {
        $result = null;
        if($entity = $this->getIterator()->current()) {
            $result = $entity->getProperty($name);
        }

        return $result;
    }
356836
public function getTable($name)
    {
        if (!$this->hasTable($name)) {
            throw SchemaException::schemaTableDoesNotExist($this->getName(), $name);
        }

        return $this->tables[$name];
    }
426844
protected function resolveName(Name $name, $type) {
        $resolvedName = $this->nameContext->getResolvedName($name, $type);
        if (null !== $resolvedName) {
            $name->setAttribute('resolvedName', $resolvedName->toString());
        }
        return $name;
    }
175943
public function resolve($entity)
    {
        $entityClass = get_class($entity);
        $meta        = $this->getMeta($entityClass);
        $this->resolveRelations($entity, $meta);
    }
75702
public function getHasOneByRelationName($name)
    {
        if ($table = $this->getReferencingTable($name)) {
            if ($model = static::getModelFromTable($table)) {
                $refField = $this->getReferencingField($table, $name);

                return $this->hasOne($model, $refField);
            }
        }

        return null;
    }
1247628
public static function model($name = "default")
    {
        if (!isset(self::$instance[$name])) {
            return null;
        }

        return self::$instance[$name];
    }
769047
private function getClass($entity)
    {
        if (is_object($entity)) {
            return get_class($entity);
        }

        if (class_exists($entity)) {
            return $entity;
        }

        $realClassName = $this->classnameResolver->resolveFullQualifiedClassname($entity);

        return $realClassName;
    }
621107
public function getTable($name = null)
    {
        if (! $name) {
            return $this->table;
        } else {
            return $this->table->onikiri()->getTable($name);
        }
    }
1335157
public function resolve($name)
    {
        $codes = $this->listComponents();

        if (isset($codes[$name])) {
            return $codes[$name];
        }

        $name = Str::normalizeClassName($name);
        if (isset($this->classMap[$name])) {
            return $name;
        }

        return null;
    }
1137611
private function resolveColumn($name)
    {
        $info = $this->unresolvedColumns[$name];
        $child = $this->createColumn($name, $info['type'], $info['options']);
        $this->columns[$name] = $child;
        unset($this->unresolvedColumns[$name]);

        return $child;
    }
851325
public function getName($entity, $quote = true)
    {
        if (is_object($entity))
            $entity = $entity->getName();
        if (!is_string($entity))
            throw new InvalidTypeException("Provide a string or a object with a getName method");
        $entity = $this->table_prefix . $entity;
        return $quote ? $this->identQuote($entity) : $entity;
    }
511942
public function getTable($name)
    {
        return $this->tables->has($name) ? $this->tables[$name] : null;
    }