Illuminate\Database\Query\Builder::first PHP Method

first() public method

Execute the query and get the first result.
public first ( array $columns = ['*'] ) : stdClass | array | null
$columns array
return stdClass | array | null
    public function first($columns = ['*'])
    {
        return $this->take(1)->get($columns)->first();
    }

Usage Example

 /**
  * get first row
  *
  * @param array $columns get columns list
  * @return mixed|static
  */
 public function first(array $columns = ['*'])
 {
     if ($this->dynamic === false) {
         return $this->query->first($columns);
     }
     if ($this->proxy === true) {
         $this->query = $this->getProxyManager()->first($this->query);
     }
     return $this->query->first($columns);
 }
All Usage Examples Of Illuminate\Database\Query\Builder::first