Find a model by its primary key.

@param  mixed  $id
@param  array  $columns
@return \Nova\Support\Collection|static|null
421050
public static function find($id, $columns = array('*'))
    {
        $instance = new static;

        if (is_array($id) && empty($id)) return $instance->newCollection();

        return $instance->newQuery()->find($id, $columns);
    }
414791
protected function select($columns=[])
    {
        $query = $this->model->newQuery()->getQuery();
        if ($columns) {
            $query->select($columns);
        }
        return $query;
    }
33137
public function find($id, $columns = ['*'])
    {
        $this->query->where('_id', '=', $id);

        return $this->first($columns);
    }
327780
public function findByUid($id, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->where('uid', '=', $id)->firstOrFail($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
995988
static public function find($id)
    {
        $model = new static;
        $result = $model->execute('SELECT * FROM '.$model->table.' WHERE '.$model->key.' = ?', [$id]);
        if (is_array($result)) {
            $result = current($result);
        }
        return $result;
    }
828224
def find(self, id, columns=None):
        
        if columns is None:
            columns = ["*"]

        if isinstance(id, list):
            return self.find_many(id, columns)

        self._query.where(self._model.get_qualified_key_name(), "=", id)

        return self.first(columns)
1153805
def find(self, id, columns=None):
        
        if not columns:
            columns = ['*']

        return self.where('id', '=', id).first(1, columns)
824732
public function where_id_is($id)
        {
            return (Arrays::is($this->_getIdColumnName())) ?
                $this->where($this->_getCompoundIdColumnValues($id), null) :
                $this->where($this->_getIdColumnName(), $id);
        }
1014736
public function findBy($field, $value, $columns = ['*'])
    {
        $this->newQuery();

        return $this->query->where($field, '=', $value)->first($columns);
    }
84292
public function get($id, array $columns = [])
	{
		if(!empty($columns))
		{
			$this->select($columns);
		}

		return $this->where($this->model->getPrimaryKey(), '=', $id)->first();
	}
543553
public function get($columns = array('*'))
    {
        $models = $this->getModels($columns);

        if (count($models) > 0) {
            $models = $this->eagerLoadRelations($models);
        }

        return $this->model->newCollection($models);
    }
685863
public function find($id, $columns = ['*'])
    {
        $this->parse();

        return $this->getHandler()->find($id, $this->getColumns($columns));
    }
492249
public function find($id, $columns = ['*'])
    {
        return is_array($id) ? $this->findMany($id, $columns) : $this->where(
            $this->getRelated()->getQualifiedKeyName(), '=', $id
        )->first($columns);
    }
1150196
public static function findOrFail($id, $columns = array('*'))
    {
        $key = (new static)->getKeyName();
        if (ctype_print($id)) {
            $idFinal = (property_exists(static::class, 'uuidOptimization') && static::$uuidOptimization)
            ? self::toOptimized($id) : hex2bin($id);

            return static::where($key, '=', $idFinal)->firstOrFail($columns);
        } else {
            return parent::where($key, '=', $id)->firstOrFail($columns);
        }
    }
285030
public function findBy($field, $id, array $columns = ['*'])
    {
        $this->applyCriteria();

        $model = $this->model->where($field, $id)->first($columns);

        if ( ! $model )
            throw new RepositoryException("Model does not exist.");

        return $model;
    }
337827
public function getModelByPrimaryKey($id)
    {
        foreach($this->models as $model)
        {
            $primaryKey = $model->getKeyName();
            if($model->$primaryKey == $id)
                return $model;
        }
    }
951063
public function findMany($id, $columns = ['*'])
    {
        if (empty($id)) {
            return new EntityCollection();
        }

        $this->query->whereIn($this->entityMap->getKeyName(), $id);

        return $this->get($columns);
    }